@uxland/redux
TypeScript icon, indicating that this package has built-in type declarations

2.1.8 • Public • Published

UXL Redux npm version

Build Status Statements Branches Functions Lines
BuildStatus Statements Branches Functions Lines

Installation

npm i @uxland/redux

Usage

Reset Action

Dispatch this action to reset all resetable reducers

dispatch(resetAction())

Create Async Slice

Creates a slice that can be used to control asynchronous cases in state

createAsyncSlice('sliceName', {status: AsyncStateStatus.idle, data: {foo: 'bar'}, error: null});
store.getState() //=> {sliceName: {status: 'idle', data: {foo: 'bar'}, error: null}}

### Store Service Creates a Redux store

const defaultSlice = createAsyncSlice('sliceName', {status: AsyncStateStatus.idle, data: {foo: 'bar'}, error: null})
const store = new StoreService({sliceName: defaultSlice.reducer}, 'store-name', true);
store.dispatch(defaultSlice.actions.setStatus(AsyncStateStatus.error))
store.getState() //=> {sliceName: {status: 'error', data: {foo: 'bar'}, error: null}}

Readme

Keywords

none

Package Sidebar

Install

npm i @uxland/redux

Weekly Downloads

58

Version

2.1.8

License

BSD-4-Clause

Unpacked Size

74.8 kB

Total Files

50

Last publish

Collaborators

  • avizcaino
  • uxland-admin