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

Split a very big react class

I have created a very big(500loc, It its very big and difficult to reason about) react class. Its an autocomplete. Whats the recommended way to split this up with react/reflux. Add the logic to som services? What is best practise. I have Stores but…
pethel
  • 5,397
  • 12
  • 55
  • 86
0
votes
1 answer

Do unrendered React components listen to Actions?

I'm working on a React application and I've encountered a problem. I'm trying to pass data from an overview page (/) to another view, ShowAllView (/#/showall). I made an Action which passes the data from overview. The ShowAllView class listens to…
koelkastfilosoof
  • 2,212
  • 1
  • 18
  • 28
0
votes
1 answer

ReactJs - how to fire dialog using reflux

I am new to reflux and I'm trying to find out the best way of triggering my react-skylight dialog.... My react app has nested components, which is very top heavy at the moment. I would like to fire off the dialog when my tabLink component is…
Bomber
  • 10,195
  • 24
  • 90
  • 167
0
votes
0 answers

Reflux actions throw an error in the console when they fail

I am using Reflux in my React app, and utilize its async actions heavily. Lately I started getting Uncaught (in promise) some-error errors in my console whenever an action failed. I researched a bit and found out that Reflux creates a promise every…
lyosef
  • 6,092
  • 2
  • 27
  • 20
0
votes
2 answers

React-Router component unmounting on transition

I'm using React-Router to navigate my mobile app. For some reason my components are unmounting on every transition and then remounting on "back". This results in lost state and lost scroll position. I'm not doing "ignoreScrollPosition" anywhere so…
RGBz
  • 81
  • 9
0
votes
1 answer

Reflux avoid hitting server every time, when data cached locally

I curious if there is any agreed upon pattern to check if data has been already loaded before hitting the server. Say I have my action that looks like this: Actions.loadRequest.preEmit = function () { $.get('/store/', function (data) { …
Dan Baker
  • 1,757
  • 3
  • 21
  • 36
0
votes
1 answer

Action methods in refluxjs

I am trying to learn refluxjs right now but looking at a github project called react-news. Specifically this line of the project is a bit confusing to…
Liondancer
  • 15,721
  • 51
  • 149
  • 255
0
votes
1 answer

How can I force reflux actions to fire in a simple test program?

I'm trying to learn how Reflux actions and stores work so I wrote a small test program. When I run the application, the code that calls toggleGem(); (which causes the Reflux Action to fire) does not immediately run. These action events are…
PatS
  • 8,833
  • 12
  • 57
  • 100
0
votes
1 answer

Returning promise from reflux store

I'm working on my first react/reflux app so I may be approaching this problem in completely the wrong way. I'm trying to return a promise from a reflux store's action handler. This is the minimum code that represents how I'm trying to do this. If I…
Lily Mara
  • 3,859
  • 4
  • 29
  • 48
0
votes
1 answer

Reflux Error triggering an action

This is either a big bug or I'm having trouble understanding the usefulness of having different view (React) handlers for different actions triggered by the store if all handlers are being called for each of those actions. Here's what I mean:…
Mauro Gava
  • 501
  • 3
  • 9
0
votes
1 answer

Async requests with data from store

I just started using refluxjs/react with webpack. I really liked the listenAndPromise async pattern, but I've encountered a problem. I got the following code: Action: var ResumeService = require('services/ResumeService'); var ResumeActions =…
Deepsy
  • 3,769
  • 7
  • 39
  • 71
0
votes
1 answer

Reflux store data rendering with line breaks and tag interpolation ES5

I do not want to use Babel/ES6 yet because reasons. I have been watching the egghead.io videos on react/reflux and have a component here I am rendering. It connects to the randomuser API and pulls 10 users into the store, when the store is updated…
kinghenry14
  • 1,187
  • 1
  • 11
  • 34
0
votes
1 answer

own timer component with react, reflux not working

I try to get used to reflux and forked a example repo. My full code is here [ https://github.com/svenhornberg/react-starterkit ] I want to create a timer component which gets the current time from a timestore, but it is not working. The DevTools…
svenhornberg
  • 14,376
  • 9
  • 40
  • 56
0
votes
2 answers

Calling UI action from store

Short version of the question: Can I fire UI actions from the store? Long version of the question: I'm writing food delivery app with reflux. It's seems like I'm not quite understand how actions should go in my applications. I have BasketStore,…
Tikhon Belousko
  • 767
  • 1
  • 9
  • 26
0
votes
2 answers

Reflux store is in one situation not listening to an action

I have a Reflux store that is listening to a 'customerLoaded' action. This action supplies customer details to the store. When the store received the new or updated customer info, it is triggered to notifiy listening components of new or updated…
Björn Boxstart
  • 1,098
  • 1
  • 12
  • 25
1 2 3
12
13