@thecodingmachine/redux-toolkit-wrapper
v2.0.1
Published
[Redux-toolkit](https://redux-toolkit.js.org/) wrapper used to write less code regarding classic CRUD operations
Downloads
2,488
Readme
TheCodingMachine Redux-toolkit wrapper
This project is a Redux-toolkit wrapper used to write less code regarding classic CRUD operations.
It's mainly used inside this RN Boilerplate : thecodingmachine/react-native-boilerplate
Installation
yarn add @thecodingmachine/redux-toolkit-wrapper
Usage
import {
buildAsyncState,
buildAsyncReducers,
buildAsyncActions,
} from '@thecodingmachine/redux-toolkit-wrapper'
import fetchOneUserService from '@/Services/User/FetchOne'
export default {
initialState: buildAsyncState('fetchOne'),
action: buildAsyncActions('user/fetchOne', fetchOneUserService),
reducers: buildAsyncReducers({
errorKey: 'fetchOne.error', // Optionally, if you scoped variables, you can use a key with dot notation
loadingKey: 'fetchOne.loading',
}),
}
More information on the dedicated documentation
License
This project is released under the MIT License.
About us
TheCodingMachine is a web and mobile agency based in Paris and Lyon, France. We are constantly looking for new developers and team leaders and we love working with freelancers. You'll find an overview of all our open source projects on our website and on Github.