weeflux-partial-reducer

1.0.0 • Public • Published

weeflux-partial-reducer

A partital reducer creator for weeflux

import flux from 'weeflux';
import partial from 'weeflux-partial-reducer';

// reducer for text prop
flux(partial('text', actions.textChanged, (state, { payload }) => payload));

flux(
  partial(
    // reducer for profile prop
    'profile',
    // handle multiple actions with one reducer
    [actions.profileLoaded, actions.profileFailed, actions.profileLoading],
    (state, { payload }) => payload
  )
);

Package Sidebar

Install

npm i weeflux-partial-reducer

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

27.1 kB

Total Files

13

Last publish

Collaborators

  • linq2js