Git Product home page Git Product logo

redux-reset's People

Contributors

gorangajic avatar wwayne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

redux-reset's Issues

Problems with redux-persist v5

Hi, I believe this package has some issues with redux-persist v5. Basically it's like it resets the state but the redux-persist package for some reason doesn't write the updated state to the storage system (asyncstorage in my situation).

But if I create a reset action by hand (that brings the state to its initial state), it works correctly. I'm integrating your package like this:

createStore(
  rootReducer,
  undefined,
  compose(
    applyMiddleware(
      thunkMiddleware,
      loggerMiddleware,
    ),
    reduxReset('RESET_APP')
  )
)

What may be causing this issue?

Exclude certain keys from state with reduxReset

I am implementing a logout in a project, where I want to keep a certain key from the state from resetting after calling reduxReset. I am also using redux-persist, which I've heard causes some trouble.

The key is "netInfo," where internet connection is evaluated and saved. After reduxReset, this variable becomes undefined. Only after closing and re-opening the app does this issue get fixed.

Reset with given state?

Hello, do you mind adding support for this?
reduxjs/redux#658 (comment)

function makeHydratable(reducer, hydrateActionType) {
  return function (state, action) {
    switch (action.type) {
    case hydrateActionType:
      return reducer(action.state, action);
    default:
      return reducer(state, action);
    } 
  }
}

// later
store.dispatch({
  type: HYDRATE_STATE,
  state: initialState
});

Woo, but the way, just figured out you are in wiredcraft!
The Wiredcraft Blog is incredibly awesome ๐Ÿ‘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.