Use an effect or the constructor of a related module
export class DataModule {
constructor(hero: HeroCollection, villain: VillainCollection, fight: FightCollection, store: Store) {
hero.addManyToCache([]);
villain.addManyToCache([]);
fight.addManyToCache([]);
// .....
}
}
@Injectable()
export class EntityEffects {
@Effect()
public readonly data$ = this.actions$.pipe(
ofType(ROOT_EFFECTS_INIT),
// ....
);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…