All Projects β†’ wwayne β†’ Redux Reset

wwayne / Redux Reset

Licence: mit
Give redux the ability to reset the state

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Redux Reset

Muster
A universal data layer for components and services
Stars: ✭ 59 (-37.89%)
Mutual labels:  state-management
Reim
πŸ€” Handle logic in frontend
Stars: ✭ 79 (-16.84%)
Mutual labels:  state-management
Freezer
A tree data structure that emits events on updates, even if the modification is triggered by one of the leaves, making it easier to think in a reactive way.
Stars: ✭ 1,268 (+1234.74%)
Mutual labels:  state-management
React Composition Api
🎨 Simple React state management. Made with @vue/reactivity and ❀️.
Stars: ✭ 67 (-29.47%)
Mutual labels:  state-management
Flutter Boilerplate Project
A boilerplate project created in flutter using MobX and Provider.
Stars: ✭ 1,194 (+1156.84%)
Mutual labels:  state-management
Radon
Object oriented state management solution for front-end development.
Stars: ✭ 80 (-15.79%)
Mutual labels:  state-management
Alveron
Elm & Reason inspired state management for React
Stars: ✭ 57 (-40%)
Mutual labels:  state-management
Reactstatemuseum
A whirlwind tour of React state management systems by example
Stars: ✭ 1,294 (+1262.11%)
Mutual labels:  state-management
Puex
(Deprecated) Simple 1kB Vuex alternative
Stars: ✭ 78 (-17.89%)
Mutual labels:  state-management
Behavior Tree
🌲 Manage React state with Behavior Trees
Stars: ✭ 85 (-10.53%)
Mutual labels:  state-management
Vue State Management Alternative
Vuex state management alternative for both Vue 1.x & 2.x
Stars: ✭ 67 (-29.47%)
Mutual labels:  state-management
Example React Native Redux
react native redux counter example
Stars: ✭ 1,186 (+1148.42%)
Mutual labels:  state-management
Compare React State Management
React createContext vs Apollo vs MobX vs Redux in a simple todo app.
Stars: ✭ 81 (-14.74%)
Mutual labels:  state-management
React Control Center
without redux、mobx and etc, writing react app with react-control-center is a funny way also, it's definitely worth doing! cc is more than a state management framework ^_^
Stars: ✭ 60 (-36.84%)
Mutual labels:  state-management
Vuex Pathify
Vue / Vuex plugin providing a unified path syntax to Vuex stores
Stars: ✭ 1,281 (+1248.42%)
Mutual labels:  state-management
Yewdux
Redux-like state containers for Yew apps
Stars: ✭ 58 (-38.95%)
Mutual labels:  state-management
Mvvm
A Flutter MVVM (Model-View-ViewModel) implementation. It uses property-based data binding to establish a connection between the ViewModel and the View, and drives the View changes through the ViewModel.
Stars: ✭ 80 (-15.79%)
Mutual labels:  state-management
Sigi
Well designed effect management framework for complex frontend app
Stars: ✭ 95 (+0%)
Mutual labels:  state-management
Stapp
Modular state and side-effects management for microfrontends
Stars: ✭ 88 (-7.37%)
Mutual labels:  state-management
Iflow
Concise & powerful state management framework for Javascript.
Stars: ✭ 81 (-14.74%)
Mutual labels:  state-management

redux-reset

Version js-standard-style Circle CI

Installation

npm install redux-reset

Basic Usage

1.Setup in createStore

import reduxReset from 'redux-reset'
...
const enHanceCreateStore = compose(
    applyMiddleware(...),
    reduxReset()  // Will use 'RESET' as default action.type to trigger reset
  )(createStore)
const store = enHanceCreateStore(reducers)

2.Dispatch reset action

store.dispatch({
  type: 'RESET'
})

Advanced Usage

Set any custom action.type to trigger reset

import Enum from 'es6-enum'
const APP = Enum('RESET')

const enHanceCreateStore = compose(
    applyMiddleware(...),
    reduxReset(APP.RESET) // Set action.type here
  )(createStore)
const store = enHanceCreateStore(reducers)

AFTER:
store.dispatch({
  type: APP.RESET
})

Reset and specific to a new initial state

store.dispatch({
  type: 'RESET',
  state: {app: {user: 'anotherUser'}} // Will use this as new initial state
})

Reset and specific to a new initial state, new state comes from a specific params in action

import Enum from 'es6-enum'
const APP = Enum('RESET')

const enHanceCreateStore = compose(
    applyMiddleware(...),
    reduxReset({
     type: APP.RESET,
     data: 'initialStateComesFrom'
    })
  )(createStore)
const store = enHanceCreateStore(reducers)

AFTER:
store.dispatch({
  type: APP.RESET,
  initialStateComesFrom: {app: {user: 'anotherUser'}}
})

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].