GithubHelp home page GithubHelp logo

What about indirect actions? about flux HOT 4 CLOSED

facebook avatar facebook commented on April 20, 2024
What about indirect actions?

from flux.

Comments (4)

fisherwebdev avatar fisherwebdev commented on April 20, 2024

I'd venture to say that S1 and S2 should probably be the same store. Why aren't they?

from flux.

totty90 avatar totty90 commented on April 20, 2024

@fisherwebdev Because they are not sharing the same data. For example S1 is a jobStore and S2 is an achievementStore. The achivements are only increased when the jobs are done.

from flux.

fisherwebdev avatar fisherwebdev commented on April 20, 2024

Why not manage both jobs and achievements in one store? If you really want to separate the code for readability/maintainability, then yes, you want to have those actions as cases in the AchievementStore's switch statement, waitFor the JobStore, and then retrieve the updated data from the JobStore. But if you can, it really sounds like they should be the same store. waitFor is really a last resort for managing complexity, and not at all the ideal in a well-designed system. Sometimes, it's unavoidable. But in your situation, I would seriously consider merging the two stores. Please remember that stores are not ORM-style models, and they are not Backbone collections. They manage a "domain" of logic and data. It sounds to me like jobs and achievements might actually be within the same domain.

from flux.

totty90 avatar totty90 commented on April 20, 2024

But I also have other stores which will change the archievement store. I
will have too many stores joied in the same store. Then is a mess again.

On Thursday, October 9, 2014, Bill Fisher [email protected] wrote:

Why not manage both jobs and achievements in one store? If you really want
to separate the code for readability/maintainability, then yes, you want to
have those actions as cases in the AchievementStore's switch statement,
waitFor the JobStore, and then retrieve the updated data from the JobStore.
But if you can, it really sounds like they should be the same store.
waitFor is really a last resort for managing complexity, and not at all the
ideal in a well-designed system. Sometimes, it's unavoidable. But in your
situation, I would seriously consider merging the two stores. Please
remember that stores are not ORM-style models, and they are not Backbone
collections. They manage a "domain" of logic and data. It sounds to me like
jobs and achievements might actually be within the same domain.


Reply to this email directly or view it on GitHub
#75 (comment).

Best regards, Melhores cumprimentos,

Blog : ProJavaScript
https://WebDesignPorto.com?utm_source=email-footer-text&utm_medium=email-footer-text&utm_campaign=email-footer-text
Twitter : @projavascript https://twitter.com/ProJavaScript
Google+ : ProJavaScript+
https://plus.google.com/104273320601694264357/posts

https://WebDesignPorto.com?utm_source=email-footer-logo&utm_medium=email-footer-logo&utm_campaign=email-footer-logo

from flux.

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.