Questions tagged [reactjs-flux]

Flux is the application architecture that Facebook uses for building client-side web applications with React. It complements React's composable view components by utilizing a unidirectional data flow.

Flux is the application architecture that Facebook uses for building client-side web applications with React. It complements React's composable view components by utilizing a unidirectional data flow.

Flux applications have three major parts: the dispatcher(s), the store(s), and the view(s) (React components).

Flux eschews MVC in favor of a unidirectional data flow. When a user interacts with a React view, the view propagates an action through a central dispatcher, to the various stores that hold the application's data and business logic, which updates all of the views that are affected. This works especially well with React's declarative programming style, which allows the store to send updates without specifying how to transition views between states.

###Some popular implementations of Flux


Related tags

822 questions
0
votes
1 answer

Mvc manage context and reusable components

I'm trying to create for a Web App an MVC Architecture with a Hierarchical Router. The goal is manage all the business logic and views with a clear pattern. Let me do some example: Route index called Index controller called; it has the…
Luca Colonnello
  • 1,416
  • 12
  • 11
0
votes
1 answer

Facebook Flux todomvc tutorial - cant start up a simple node http-server because of package.json file

Warning: This question is from a noob :) I'm trying to play with Facebook flux todolist tutorial(flux-todomvc). I want to run an http server on my localhost port 8000 and usually I do that by running a script in the json.package file that looks like…
Nick Pineda
  • 6,354
  • 11
  • 46
  • 66
0
votes
1 answer

How to dynamically select store

I'm trying to figure out the best way to dynamically select a component and store based on the data my server receives. The app is based on these examples: https://github.com/yahoo/flux-examples/tree/master/fluxible-router but a little…
David Gilbertson
  • 4,219
  • 1
  • 26
  • 32
0
votes
1 answer

Parent Component react to multiple children component inputs

I am a bit confused how to build my react/flux (flummox) app in a nice and understandable way. I have a Parent component called StrategyListwhich displays a filterable list of "strategies". The strategies are stored in a StrategyStore (Flux). Now my…
exophunk
  • 188
  • 6
0
votes
1 answer

Testing a React Store with Jest

I'm trying to test my React store using Jest (I'm adhering to the Flux architecture) but am not sure when I need to mock up a store function. To illustrate my point, here's a portion of my store code: export default class AdminStore extends…
seanchen1991
  • 1,255
  • 2
  • 11
  • 16
0
votes
1 answer

ReactJs server data handling

I have small reactJS application in Flux architecture. I need to fetch server side data in each button click. I write some code in STORE like these var pieDataForMembers=[]; var ReportStore = assign({}, EventEmitter.prototype, { …
0
votes
1 answer

Flux store depends on an asynchronous download in another store

I'm learning React and flux. Say there's a route like // Route /continent/:continentId/countries // Example /continent/europe/countries There are two stores, a ContinentsStore and a CountriesStore What's the best design pattern, in Flux, so that…
Qiming
  • 1,664
  • 1
  • 14
  • 18
0
votes
2 answers

React component sibling event watching - am I doing it the best way?

I'm new to React and am still getting my head around flux. My personal Hello World project is a time tracking/billing app, basically a glorified stopwatch, and I've got stuck. Essentially there's a component with multiple
xcession
  • 268
  • 2
  • 11
0
votes
1 answer

Does Flux always have to use browserify?

I've read theoretical overviews of the flux application architecture. I know flux and react go hand in hand, but all the getting started tutorials use browserify right away. What does browserify provide to react? Why is browserify necessary for…
Connor Leech
  • 18,052
  • 30
  • 105
  • 150
0
votes
1 answer

Flux: Higher order components to set up store listeners

Following this article Mixins Are Dead. Long Live Composition, I've set up a Pet component listening to pet and owner stores user a higher order component. But how would one pass an owner_id from the pet resource into connectToStores? Is this simply…
niftygrifty
  • 3,452
  • 2
  • 28
  • 49
0
votes
2 answers

ReactJS - props vs state + Store designing

Imagine the following: you're writing a 'smart-house' application which manages a temperature in your house. In my view I'd like to: see current temperature for each room set desired temperature for each room see whether air conditioning is turned…
slnowak
  • 1,839
  • 3
  • 23
  • 37
0
votes
0 answers

react flux subscription callback , many to many relationships

I am new to React and Flux. I am trying to build a subscription like system. With many to many relation ship but i am confused on how to implement the callback: The scenario: User a, b, c subscribe to item 1. User a, b, d subscribe to item 2. User…
LanNguyen
  • 234
  • 3
  • 15
0
votes
1 answer

How to reset the Flux stores between jasmine tests?

When running tests on stores with karma & jasmine (instead of jest), the store's state persists between tests. What's the best way to reset the state for every test? With jest, every test is run in its own environment automatically. This post…
Andrew Cross
  • 1,921
  • 2
  • 19
  • 32
0
votes
1 answer

Flux design pattern - ambiguity about view concept

After reading many explanation about flux design pattern 1, I quite understood how it work. The dispatcher is a lot like JINI 2 lookup service. And the advantage is clear, the dispatcher doesnt need to know how to perform action and who will perform…
Saloparenator
  • 330
  • 1
  • 13
0
votes
2 answers

How to test actions in Flux/React?

I'm trying to figure out how to test actions in flux. Stores are simple enough with the provided example, but there seems to be nothing out there for the actions/data/api layer. In my particular app, I need to pre-process something before posting it…
Andrew Cross
  • 1,921
  • 2
  • 19
  • 32