@Select(state => state.animals)
animalsWithDecorator$: Observable<string[]>;
和
animalsWithMethod$ = this.store.select(state => state.animals);
看来select
的类型更安全,因为如果state.animals
将其类型更改为number[]
animalsWithMethod$
也会对其进行更改,但是animalsWithDecorator$
仍将是{ {1}}。
答案 0 :(得分:0)