πŸ“–No-Reducer Actions

Import functions from the library

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

Here are functions to manage the reducers

Function
Action

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') )

Last updated