Questions tagged [refluxjs]

A simple library for uni-directional dataflow application architecture inspired by ReactJS Flux

A simple library for uni-directional dataflow application architecture inspired by (available at https://github.com/reflux/refluxjs)

Similarities with Flux

Some concepts are still in Reflux in comparison with Flux:

  • There are actions
  • There are data stores
  • The data flow is unidirectional

Differences with Flux

Reflux has refactored Flux to be a bit more dynamic and be more Functional Reactive Programming (FRP) friendly:

  • The singleton dispatcher is removed in favor for letting every action act as dispatcher instead.
  • Because actions are listenable, the stores may listen to them. Stores don't need to have a big switch statements that does static type checking (of action types) with strings
  • Stores may listen to other stores, i.e. it is possible to create stores that can aggregate data further, similar to a map/reduce.
  • waitFor is replaced in favor to handle serial and parallel data flows:
    • Aggregate data stores (mentioned above) may listen to other stores in serial
    • Joins for joining listeners in parallel
  • Action creators are not needed because RefluxJS actions are functions that will pass on the payload they receive to anyone listening to them
191 questions
1
vote
1 answer

Adding resolver to React-router

In react-router, is there any way to pass a property from the Route-definition that can be picked up within the Router.run function? I want specific actions to fire for specific routes. Something like this perhaps:
thsorens
  • 1,308
  • 12
  • 21
1
vote
1 answer

In "Reflux", what purpose do actions serve?

I'm familiarising myself with both Flux architecture, and Reflux - the simpler version, without a dispatcher - for use with ReactJS. In full Flux, it sounds like actions have (or at least, can be made to have) a definite and non-trivial purpose:…
joshua.paling
  • 13,762
  • 4
  • 45
  • 60
1
vote
1 answer

How to get initial state with AJAX in a Store with Reflux

Recently I've been working on React and Reflux. The part I get stuck is that I can't get initial state with AJAX in a store in Reflux. What I tried is just calling the ajax($.getJSON) in getInitialState function in Store.js, setting the initial…
Ryo Ikarashi
  • 341
  • 4
  • 11
1
vote
1 answer

React not rendering data coming from reflux store

I am facing trouble with my code not rendering after it gets passed on data from a store. I am able to console.log() the data coming from the store but the data is not displaying in the DOM. Here is what my component looks like var ItemList =…
Bazinga777
  • 5,140
  • 13
  • 53
  • 92
1
vote
1 answer

React+Reflux how should stores and components handle onChange key presses with ajax

I would like some help wrapping my head round a react/reflux pattern that I have going on, and if its acceptable. I have a form component which renders several form elements such as the example below. The form component is connected to a Reflux…
Nick
  • 239
  • 3
  • 14
1
vote
1 answer

Reflux Stores - Avoiding regression issues/naming conflicts

We're building a rather complex React + Reflux application and have a couple of stores that listen to some actions originating from some other component. Eg: var FooStore = Reflux.createStore({ listenables: [FooActions, BarActions], ... }); I…
Markus Coetzee
  • 3,384
  • 1
  • 29
  • 26
1
vote
1 answer

Better use some large or multiple small stores with React and Reflux

A while ago we started with our first web-based single page application. We started with React and Flux (Facebook implementation), but recently switched to Reflux for the Flux implementation. While the Fb Flux implementation knows the concept of…
Björn Boxstart
  • 1,098
  • 1
  • 12
  • 25
1
vote
1 answer

Reflux: having multiple components access the same Store

tl;dr: The UUID for the GraphStore changes every time I add a new Graph to it. This leads me to assume each Graph is creating its own unique GraphStore. I want them all to share a single store. I have a React Dashboard component that contains…
Matthew Herbst
  • 29,477
  • 23
  • 85
  • 128
1
vote
1 answer

Different actions for common components in FluxJS

In my flux application, I have a DropDown React component that renders itself with an array of Key Value Pairs. I'd like to have two different drop downs, one with Country Data, and another with City Data. In the Flux pattern, each dropdown would…
Alan
  • 45,915
  • 17
  • 113
  • 134
1
vote
1 answer

How to properly initialize Store from Component in a Reactjs+Reflux app?

I have a simple navigation bar use case where I have Components NavBar.jsx NavBarItem.jsx Stores NavStore.js Using Dependencies React Reflux I'd render the navbar like The question is my…
ttback
  • 2,051
  • 5
  • 27
  • 40
1
vote
1 answer

React Reflux: Correct way to initiate stores and update dependent components

I'm just starting with Reflux and React. I've watched several React/flux tutorials/videos, but I haven't found the correct way to set up my application with Reflux/React and React Router: Imagine I have the following url:…
1
vote
1 answer

How to disambiguate Store events when using Reflux or Flux?

I've had something bothering me for the past couple of days and I can't seem to come up with a solution that I like. I'm using refluxjs, but I think its applicable to vanilla flux as well. So, say I have a React ComponentOne that calls a flux action…
Dustin Wyatt
  • 4,046
  • 5
  • 31
  • 60
1
vote
0 answers

Requiring superagent results in error in Jest

I'm getting the following error when running Jest tests: /Users/hugo/src/feedback/www/assets/app/node_modules/superagent/lib/node/index.js: /Users/hugo/src/feedback/www/assets/app/node_modules/superagent/node_modules/debug/node.js: Cannot read…
Hugo
  • 2,186
  • 8
  • 28
  • 44
1
vote
1 answer

Reflux event not triggering

I'm working on a React app with Reflux and I'm having a problem connecting a store to a component. Here's the code // src/stores/post.js var Reflux = require('reflux'); var $ = require('jquery'); var PostActions =…
Hugo
  • 2,186
  • 8
  • 28
  • 44
0
votes
1 answer

ReactJS/Reflux Converting mixins to ES6

I'm trying to convert the following Compenent to ES6, I already modified all the code for Store/Action, I can't figure out a solution to replace mixins and use normal ES6. This is for a front end project, I'm just trying to parse JSON Data into…
Oussama
  • 63
  • 1
  • 9