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
0
votes
1 answer

React Reflux: onUpdate#this.trigger(rows) causes an infinite loop

I have a React component that displays radio buttons. Changes to these should be handled by Reflux. As I understand it this.trigger(object) should be called to save any changes to the object. Unfortunately that causes an infinite loop. I have posted…
martins
  • 9,669
  • 11
  • 57
  • 85
0
votes
1 answer

How to set state of container component from its child in reactjs and reflux?

I have a header that is supposed to change its inner components whenever there is a change in its state, like when a user clicks on the login button, the users profile navigation replaces the button. My button is part of a navigation component and…
Bazinga777
  • 5,140
  • 13
  • 53
  • 92
0
votes
0 answers

Is it possible to listen for changes to a specific field of an object (stateKey) using Reflux?

For my store, I have something along the lines of: var GraphStore = Reflux.createStore({ listenables: [GraphActions], updateGraphedMetrics: function(graphs) { ... this.trigger(graphs); }, getInitialState: function()…
Matthew Herbst
  • 29,477
  • 23
  • 85
  • 128
0
votes
0 answers

Wield scope in reflux and immutable js ES6 webpack chrome

I am experiencing wield scoping issue in ES6 with webpack and chrome Here is my code: 'use strict' import Reflux from 'reflux' import Immutable from 'immutable' import Something from 'something' import Cursor from 'immutable/contrib/cursor' //…
nilveryboring
  • 653
  • 1
  • 9
  • 18
0
votes
2 answers

Should action talk with store?

I am using react with flux architecture and I have a problem I face it. I need to create an action that gets a user id and fetches the user. Here is the code: var createAction = require('common/scripts/actions-helpers/create-action'), resource =…
Naor
  • 23,465
  • 48
  • 152
  • 268
0
votes
2 answers

Listen to Reflux actions outside of stores

I'm trying to figure out how to fit ajax calls into the flux/reflux way of doing things. From the scraps of info I've found online it seems correct to separate the API logic from the stores. Starting there, I've created a client API that makes…
captDaylight
  • 2,224
  • 4
  • 31
  • 42
0
votes
1 answer

React-router transition always creates handler

I just started, so I don't know if this is desired behavior or if I have missed something. I'm using the Flux architecture (specifically Reflux but that should not be relevant). In my super-simple test app: var App = React.createClass({ render:…
blackwood
  • 362
  • 3
  • 12
0
votes
1 answer

React / Reflux store events

When using React with Reflux, stores have only one event for components to listen to. Assuming that: I have a ProductStore that contains a list of products I have two components that listen to changes in this store: a product list that is…
efdee
  • 2,255
  • 3
  • 20
  • 26
0
votes
1 answer

Animating Data Store change

I have a store which increments its data by 1 every second. I want my component to animate a rectangle, that "fills horizontally" as the data increments so basically: 0 [ ] 0.2 #conceptually [= ] 0.5 #conceptually [==== ] 0.75…
Secret
  • 3,291
  • 3
  • 32
  • 50
0
votes
1 answer

Uncaught TypeError: undefined is not a function in RefluxJS

Following the tutorials from this site: http://blog.krawaller.se/posts/the-reflux-data-flow-model/ I'm looking at replacing var chatRef to a dummy data instead of using new Firebase(...) as shown in the author example. Baffled how exactly this line…
James Lei
  • 340
  • 2
  • 5
  • 15
-1
votes
1 answer

in reflux, can't reuse Component throught global var

i am try building for my project which used to reflux model, as you know, the reflux have: myblog -actions -stores -conponents -----register.js -libs -----react.js //or react.js add on, tried using -----JSXTransformer.js -----react-with-addons.js…
Jimmy Mac
  • 37
  • 2
  • 5
1 2 3
12
13