tkit-actions
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

name: actions menu: 'redux'

npm i tkit-actions

Usage

import { createAction, Action, handleActions, bindActionCreators, Dispatch } from 'tkit-actions';
 
const actions = {
  doSomething: () => createAction('DO', {})
};
 
const reducer = handleActions({
  DO: <S>(s: S, action: Action<{}>) => ({ ...s })
});
 
// bindActionCreators 通过 reselect 添加了 cache
function mapDispatchToProps(dispatch: Dispatch) {
  return {
    actions: bindActionCreators(actions, dispatch)
  };
}

Readme

Keywords

none

Package Sidebar

Install

npm i tkit-actions

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

3.69 kB

Total Files

6

Last publish

Collaborators

  • yangqianjun