第三章里面的 redux_basic里面有个疑问
refanbanzhang opened this issue · comments
热饭班长 commented
componentDidMount() {
store.subscribe(this.onChange);
}
componentWillUnmount() {
store.unsubscribe(this.onChange);
}
这里的对store.unsubscribe应该是会报错的,因为unsubscribe方法是subscribe的返回值
store.unsubscribe = store.subscribe(this.onChange);