GithubHelp home page GithubHelp logo

Comments (3)

fisherwebdev avatar fisherwebdev commented on April 25, 2024

A lot of this seems very specific to your application, and it's difficult to get enough context from what you have written here. Perhaps more code would help the community here understand your issue?

But on a side note, this concerns me:

alertStore.add({contents: new UnlockJob({...})})

That looks an awful lot like a setter on your store, and a store should not have any setter methods. The only way data should be getting into the store is though the callback it registers with the dispatcher.

from flux.

totty90 avatar totty90 commented on April 25, 2024

A lot of this seems very specific to your application, and it's difficult to get enough context from what you have written here. Perhaps more code would help the community here understand your issue?

Imagine a popup, where would you store in your app?

from flux.

fisherwebdev avatar fisherwebdev commented on April 25, 2024

I would render a PopupControllerView at the bottom of the body, in it's own React root, which would be listening to stores. It might have number of child popups, or I might create logic to dynamically create those children.

I might maintain a PopupStore, which would have currentPopupID value, which could be null. Down in my list of popup components, they would all receive currentPopupID as a prop, and if their popupID matched, they would get displayed.

Or I would simply let the values in the other stores drive what popup to render more directly, perhaps with some logic in PopupControllerView determining if a popup should be displayed, or which one.

Basically this is all just Flux + React -- nothing special going on, other than creating a separate root for it, and I'm not even sure that's necessary. The generic Popup React component could be made to simply take props and let the store or controller-view above it determine those props. You could then use that generic component to compose various different popups.

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.