Closed alexej-strelzow closed 1 month ago
please create github repo for reproduce
@splincode this occurs when I inject a service into the state, actually it is enough to add the @Injectable() decorator - necessary when services get injected (see migration guide of NGXS). So without the decorator + constructor it works.
@State<MasterStateModel>({
name: 'master',
defaults: {
apps: []
}
})
@Injectable()
export class MasterState {
constructor(@Inject(LOGGING_SERVICE) private _logger: LoggingInterface) {
}
}
@splincode you also MUST have the following 2 flags in angular.json:
"optimization": true,
"aot": true
I think that EmitterAction gets tree-shaken away.
outdated -> closed
I'm submitting a...
Current behavior
import { EmitterAction, Receiver } from '@ngxs-labs/emitter';
@Receiver() public static setRegistered(ctx: StateContext<MasterStateModel>, action: EmitterAction<string>) {
the EmitterAction class cannot be found at runtime when compiled with Angular 9 -> ivy. No bug at compile time.
Workaround:
@Receiver() public static setRegistered(ctx: StateContext<MasterStateModel>, action: any) {
any instead of EmitterAction
Expected behavior
Should work with type EmitterAction
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
-
Environment