Opinionated, Redux abstraction with built-in immutability, async and more. Heavily dva inspired.
Using npm:
$ npm install redux-data-model redux-data-model-hooks --save
Using yarn:
$ yarn add redux-data-model redux-data-model-hooks
Naturally, the redux-data-model-hooks package is optional, in case you're willing to use our hooks API.
- Easy to use and learn. Only a few public interfaces (i.e. combineModelReducers, modelRootSaga, Model, connectModel or equivalent hooks).
- Boilerplate reduction (i.e. actions, dispatchers, reducers).
- Immutability with normal JavaScript objects and arrays. No new APIs to learn!
- Async, typescript, memoised selectors, and hooks support.
- Tiny footprint (i.e. ~6KB).
- counterWithConnectModel (Demo): Simple count example, without hooks api.
- counterWithConnectModelAndDebouncedButtons (Demo): Simple count example, without hooks api, that debounces increment/decrement buttons for 3 seconds.
- counterWithConnectModelAndConfirmationDialog (Demo): Simple count example, without hooks api, that is using a confirmation dialog, prior to incrementing/decrementing.
- counterWithConnectModelWithNestedNamespace (Demo): Simple count example, without hooks api. It uses a nested namespace, so that data can be grouped in different parts of the store.
- counterWithHooks (Demo): Simple count example, with hooks api.
- rest (Demo): Multi model rest example, with hooks api. Data is fetched from jsonplaceholder.typicode.com
- restWithNormalization (Demo): Multi model rest example, with hooks api, that employs selector memoization and reuses action types across models, as a way to normalize data. Data is fetched from jsonplaceholder.typicode.com
Documentation is available here: https://kayak.github.io/redux-data-model/
Copyright 2020 KAYAK Germany, GmbH
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Crafted with ♥ in Berlin.