I have a class Third, that requires a token in its constructor to create it.
import Third from './Third.js'
export class Second {
private _instanceOThird = new Third(_token)
constructor(
_token: string
) {}
}
import Second from './Second.js'
export class First {
init() {
const _instanceOfSecond = new Second('MyToken');
}
}
The issue is that the token from Second comes from yet another class, called First. Class Second doesn't use the token but just needs it so that Third can be created within it.
Is this an anti-pattern of passing around data?