📜  如何从 store in action redux 中获取状态 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:03.510000             🧑  作者: Mango

代码示例1
import store from '../store';

export const SOME_ACTION = 'SOME_ACTION';
export function someAction() {
  let items = store.getState().items;
  return {
    type: SOME_ACTION,
    items: items,
  }
}