Код: Выделить всё
import {
ENVIRONMENT_TOKEN
} from '@reg/environment/domain'
@Injectable({ providedIn: 'root' })
export class RegStore extends ImmutableStore {
#env = inject(ENVIRONMENT_TOKEN)
constructor() {
super({
name: 'RegistrationStore',
mutationProducerFn: produce as unknown as MutationFn,
initialState: new RegState(),
plugins: [
// this.#env.signalStoryStorePlugins ERROR 'this' call cannot be used before 'super'
useStorePersistence({
persistenceKey: 'RegStore',
persistenceStorage: localStorage,
}),
]
})
}
store: Immutable = this.state()
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... e-the-this
Мобильная версия