0.1.14 • Published 3 years ago

@aucsys/redux-ez v0.1.14

Weekly downloads
4
License
MIT
Repository
github
Last release
3 years ago

redux-ez

Ez reducers for your basic CRUD needs

NPM JavaScript Style Guide

Install

npm install --save redux-ez

Usage

  1. Create instance of ReduxEz
    const ez = ReduxEz({
        baseUrl: "https://example.com/api",
        makeHeaders: async () => {return {'x-header': 'value'}}
    })
  2. Use exposed methods to create slice actions with desired functionality

     const {
         initialState: testInitialState,
         thunk: getTest,
         reducers: testReducers,
         stateNames: getTestStateNames
     } = getSliceActions({
          actionName: "getTest",
          storeName: TEST_STORE_NAME,
          entityNameInStore: "test",
          thunkName: "/test/get",
          showToastOnSuccess: true,
          showToastOnFail: true,
          makePath: (payload) => { // Action payload
              return `/test/${payload.id}`
          }
     })

License

MIT © aucsys-com

0.1.13

3 years ago

0.1.14

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago