Store的用法

Store就是把它们联系到一起的对象。Store有以下职责:

  • 维持应用的state:
  • 提供getState( )方法获取state;
  • 提供dispatch(action)方法更新state;
  • 通过subscribe(listener)注册监听器;
  • 通过subscribe(listener)返回的函数注销监听器
  • 提供dispatch(action)方法更新state;
  • store.dispatch('TOGGLE_LOADING')/

    这个其实是在store中触发改变它里面的值!

猜你喜欢

转载自blog.csdn.net/wandoumm/article/details/82978230
今日推荐