I have the following service:
import {
ENVIRONMENT_TOKEN
} from '@reg/environment/domain'
@Injectable({ providedIn: 'root' })
export class RegStore extends ImmutableStore<TRegState> {
#env = inject(ENVIRONMENT_TOKEN)
constructor() {
super({
name: 'RegistrationStore',
mutationProducerFn: produce as unknown as MutationFn<TRegistrationState>,
initialState: new RegState(),
plugins: [
// this.#env.signalStoryStorePlugins ERROR 'this' call cannot be used before 'super'
useStorePersistence({
persistenceKey: 'RegStore',
persistenceStorage: localStorage,
}),
]
})
}
store: Immutable<TRegState> = this.state()
}
How could the call – this.#env be restructured to remove the error?