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

How to connect my react component to reflux store?

I am kinda new to React and Reflux and modern JavaScript development. Trying to learn. So, I am making a component that is basically a sort of a chat window. A list with lines and an input box. When you type something into the input box and hit…
Mad Wombat
  • 14,490
  • 14
  • 73
  • 109
1
vote
1 answer

Migrating Reflux Stores to ES6 syntax

I have been trying to refactor Some existing React-Reflux code to ES-6 syntax, I have 3 Stores for people, Projects and events. They Do basically the same thing but call different apis to fetch results. so I tried to do the following : class…
1
vote
1 answer

contenteditable div caret position issue with reflux but not flux

newby alert I am trying to use a contenteditable div in a react component hierarchy. I am hoping to use reflux instead of flux as I like the way one sets up actions and stores better in reflux (much less boilerplate, more features). However, I am…
1
vote
1 answer

Clearing data from multiple Stores in React Reflux from one Action function

I have a simple _clear function in my AuthActions file which sets this.data to undefined. I am calling this function only when a user logs out. When I log back in with a different user, the data from the previous account is still hanging out in…
Jeremy Sullivan
  • 995
  • 1
  • 14
  • 25
1
vote
1 answer

How to Identify components that trigger changes to state in React+Flux?

What is the canonical React+Flux way to ID components that trigger changes to state? I've got an application that allows a user to create palettes using the HSL color space. Here's the component structure of my app: Container (this component gets…
Matt Parrilla
  • 3,171
  • 6
  • 35
  • 54
1
vote
0 answers

reflux.listento works wrong for me

I am building an front app using react and reflux,react-router and using browserify. and I got a console message. [object Object] is missing a listen method Do you know why i got a exception like this?? Component var TrendSearchBox =…
kangtaku
  • 152
  • 2
  • 2
  • 11
1
vote
1 answer

Each instance receive events when rendering my ES6 React/Reflux component twice

I have a component (Which performs text input) rendered twice inside another one. When I hit a key in one of the text input components, each is notified... The component takes a time string like "14:30", and should allow hour & minute parts…
Mike Aski
  • 9,180
  • 4
  • 46
  • 63
1
vote
0 answers

Multiple method cycle reflux store

Does anyone know the complete sequence of reflux methods? I have this reflux store and its relation shown in the flow below: component =(listen state)=> store =(listen)=> action =(listen trigger)=> component That is the complete cycle, and I am…
Rei Dien
  • 196
  • 13
1
vote
1 answer

Why can't synchronous actions in Reflux also be used as promises?

In my code, I use the async actions as promises pattern heavily. Here's an example: var actions = Reflux.createActions({connectToFacebook: {asyncResult: true}}); actions.connectToFacebook.listenAndPromise(function(){ var facebookOauthPromise =…
user686782
  • 992
  • 1
  • 10
  • 18
1
vote
1 answer

How can I access lodash in the javascript console when using reflux

I am working on an app which uses the Reflux framework around React. When we want to use an external library in a file we require with: import _ from 'lodash'; Then we can use the _. to access all the lodash methods. I would like to also like to be…
wuliwong
  • 4,238
  • 9
  • 41
  • 69
1
vote
1 answer

Not sure what .listen() in refluxjs does exactly

In refluxjs I'm not sure what .listen() does. From my understanding, it has the same concepts as nodejs eventemitter but reflux wraps in its own way. I can't seem to find documentation on this anywhere. Maybe I missed it. I would like to find…
Liondancer
  • 15,721
  • 51
  • 149
  • 255
1
vote
1 answer

Listening directly to Reflux Actions in Component

From what I've read the pattern is the Components pass data to the Actions which Pass to the Store whose value changes trigger updates in Components that subscribe to the Stores. My question is how to "react" to these triggered updates in the form…
Dan Baker
  • 1,757
  • 3
  • 21
  • 36
1
vote
1 answer

Reflux callback after store is changed

I'm working on Chrome Extension using React.js and Reflux. Now I need to notify all parts of extension about changes when store is updated with one callback. Something like: function(newStore){ chrome.runtime.sendMessage({action: 'updateStore',…
Ladislav M
  • 2,157
  • 4
  • 36
  • 52
1
vote
1 answer

Reflux store and actions flow logic: how to pass data from a store to another store

Is it Ok for a store to create an action to another store? My data in store A always changing frequently, and i want to pass the data in store A to store B every time that my data in store A gets an update. So I've made a listener in store A, on…
user3341337
  • 113
  • 6
1
vote
1 answer

Why doesn't the Reflux.js listenAndPromise helper work?

I'm using qwest to query my endpoint as shown below, the onGetResourceCompleted handler fires as expected but data is undefined. Why? var Actions = Reflux.createActions({ 'getResource': { asyncResult: true…
Will
  • 1,149
  • 12
  • 25