Git Product home page Git Product logo

Comments (3)

Matmo10 avatar Matmo10 commented on July 20, 2024 1

I think I figured it out actually. For dev environment, I added it to DEV_REDUCERS:

const DEV_REDUCERS = [stateSetter, storeFreeze, localStorageSync(['yourReducer'], true)];

and for prod, I changed productionReducer to the following:

const productionReducer = compose(localStorageSync(['yourReducer'], true), combineReducers)(reducers);

You can create a PROD_REDUCERS array if you want to follow the DEV_REDUCERS pattern but this seems to be working for me.

from angular-webpack-starter.

Matmo10 avatar Matmo10 commented on July 20, 2024

I've got it to work by doing this:

StoreModule.provideStore(compose(
            localStorageSync(['filters'], true),
            combineReducers
            )(reducers)
        )

But I had to comment out all the helpful/extra stuff in /reducers/index.ts (as you can tell, I'm just using reducers...not rootReducers)

I'm still trying to figure out how to incorporate it into the developmentReducers/productionReducers while also keeping it AOT friendly.

from angular-webpack-starter.

qdouble avatar qdouble commented on July 20, 2024

I may or may not add it on later on, I'm trying to keep this repo based around stuff that I use as it will be easier for me to make sure everything is working right and support it. I'm not currently using it in any of my projects, so wouldn't be quite sure of the best practices or limitations of using it.

@smith64fx @Matmo10 if either you come up with a good way for it to work, maybe we can add instructions to the wiki?

from angular-webpack-starter.

Related Issues (20)

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.