Giter Club home page Giter Club logo

Comments (7)

skellock avatar skellock commented on June 2, 2024

This is a really neat suggestion. I’m getting hung up a bit on the the DEFAULT name. Maybe PASSTHROUGH or NESTED or ELSE or maybe null?

Thoughts?

from reduxsauce.

vaukalak avatar vaukalak commented on June 2, 2024

I'm not sure if nested is the only one use case.. for example the default handler could do something like:

const defaultHandler = (state, { type, payload }) => {
  if (type.indexOf('FOO_') === 0) {
    return { ...state, fooActionsCount: state.fooActionsCount + 1 };
  }
  return state;
}

This is certainly bad code, but just as idea, that default handler is not always delegate to nested reducers. I think DEFAULT or ELSE could work. But in "standard" reducer style you usually use default keyword to mention, that this block handles all actions that are not mentioned above. So I think DEFAULT should be the best name for the constant.

from reduxsauce.

skellock avatar skellock commented on June 2, 2024

I see where you’re coming from.

I’ve never written anything like that but I guess that could be useful.

I’d be ok with this. You up for a PR?

from reduxsauce.

vaukalak avatar vaukalak commented on June 2, 2024

done :)

from reduxsauce.

NachtRitter avatar NachtRitter commented on June 2, 2024

Nice! I've been researching redauxsauce for this case and was going to make PR like yours :)
I hope @skellock will merge it and publish soon this feature.

P.S. Also I'd like to ask @skellock why reduxsauce has redux package in dependencies. I didn't see any usages of redux package in code. Am I something losing sight?

from reduxsauce.

vaukalak avatar vaukalak commented on June 2, 2024

@skellock is there forecast when npm build with this will be released?

from reduxsauce.

skellock avatar skellock commented on June 2, 2024

Sorry for the delay. I have it merged into master, but wanted to test a few things to make sure we're good. I don't have a good ETA other than once these other fires are extinguished. =)

from reduxsauce.

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.