1.0.11 • Published 12 months ago

no-reducer v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

No-reducer

Handling Redux's state without creating reducers

www.no-reducer.com

This tool is for developers who use Redux to manage states but want to avoid creating reducers multiple times. With this tool, you can create states without having to create reducers. You can also perform various actions on the state tree, like inserting, replacing, updating, or removing .etc.

create oject user

This library is an add-on, which means you can use it alongside your existing way of working with Redux. It won't affect anything in your current workflow.

Demo

LIVE DEMO - Todo List

Todo List - Src code and instruction

All features - Src code and instruction

Installation

npm i no-reducer

To use no-reducer, you need a simple installation by importing no-reducer on the page of combineReducers. You can name any name you want for the store object.

For example, I named it ds in the combineReducers of Redux.

import { combineReducers } from "redux";
import { reducer } from "no-reducer";

export default combineReducers({
    ds: reducer
});

Actions

Import actions from the library.

import { create, insert, remove, replace, update, append, clear } from "no-reducer"

Here are functions to manage the reducers | Action | How to use ( with dispatch ) | | ------ | ------ | | create | dispatch( create('YOUR-OBJECT-NAME', { YOUR: OBJECT }) )| | insert | dispatch( insert(DESTINATION, 'OBJECT-NAME', {YOUR:OBJECT} ) )| | remove | dispatch( remove('DESTINATION') )| | replace | dispatch( replace('DESTINATION',{YOUR:OBJECT}) )| | update | dispatch( update('DESTINATION', {YOUR:OBJECT}) )| | append | dispatch( append('DESTINATION',my-new-array-items) )| | clear | dispatch( clear('DESTINATION') )|

Please refer to the document on www.no-reducer.com for further information.

Example

import { create } from "no-reducer";
...
const response = await axios.get('https://jsonplaceholder.typicode.com/users/2');
await dispatch(create('User', response.data));

create oject user

Documents

Manual: https://docs.no-reducer.com

Git: https://github.com/vnseattle/no-reducer

Tutorial: https://medium.com/@thankyouforyouremail3000/using-reducer-with-no-reducer-29bc29c7622b

Happy Coding

Dev9x @2023

1.0.11

12 months ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago