0.4.0 • Published 3 years ago

@nnwa/redux-saga-actions v0.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

@nnwa/redux-saga-actions

帮助 react 应用更容易使用数据流

使用

$ yarn add @nnwa/redux-saga-actions
// store.js
import {
  createSaga,
  GenStateType,
  genUseReduxState,
  getState,
} from '@nnwa/redux-saga-actions';
import genStore from '@nnwa/redux-saga-actions/store';
import * as models from './models';

export const store = genStore(models);
const state = getState(models);
export type IState = typeof state;
export const useReduxState = genUseReduxState<IState>();

接口使用

createActions

const model = {
  namespace: 'user',
  state: {},
  reducers: {},
  effects: {
    fetchUser() {},
  },
};

const actions = createActions(model);

actions.fetchUser(); // { type: 'user/fetchUser' }
0.4.0

3 years ago

0.3.12

3 years ago

0.3.9

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.0

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.2.4

3 years ago

0.2.3

3 years ago