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
2 answers

'this' undefined in Reflux.createStore()

I'm trying to set state properties via this in my Reflux store, but whenever I attempt to set a property I get the following error: Uncaught TypeError: Cannot read property 'triggers' of undefined I've using Babel to compile my JSX, so not sure if…
Steven Bennett
  • 189
  • 1
  • 3
  • 16
0
votes
2 answers

ReactJs + Reflux // trigger is executed on null component?

I'm trying to use Reflux inside my ReactJs app. I'm having an issue where a component listening to a data store is executing the callback on an empty component instance instead of the actual component that was instanced. Upon calling the action…
NGPixel
  • 392
  • 2
  • 9
0
votes
1 answer

react+flux/reflux -- is it ok for sub components to call actions

My question is similar to this one: How to manage component rendering when there are several small, repeatable sub-components I am building a RequirementsList component, which has a list of 'Requirement' components. Each Requirement may have 0 or…
Mopparthy Ravindranath
  • 3,014
  • 6
  • 41
  • 78
0
votes
1 answer

Reflux: component does not get the triggered event from store

Following a good React course from udemy, I used Reflux to create a store, however, the triggered event from the store can not be caught by the component. My question: Why using ImageStore.orderImage(TODO 1 in the component.jsx) does not work:…
Charlie Chen
  • 224
  • 3
  • 12
0
votes
1 answer

React JS Component "wait for props"

This is not a question as much "how to make this work" as much as it is a "was this the best way." Here's my code: /** * React Static Boilerplate * https://github.com/koistya/react-static-boilerplate * Copyright (c) Konstantin Tarkus (@koistya) |…
motleydev
  • 3,327
  • 6
  • 36
  • 52
0
votes
1 answer

Updating the display of a row in a list

I am implementing a React - Reflux architecture based application, which shows a list of rows in a page. Each row in the list allows inline editing of the properties. The save button in the row, calls a reflux-action, which updates data to…
Mopparthy Ravindranath
  • 3,014
  • 6
  • 41
  • 78
0
votes
2 answers

Reflux/React - Managing state with asynchronous data

I think this is a trivial use case but I am still getting to grips with aspects of Flux and React. In my example I am using Reflux and React Router. I have a basic component that displays the details of a sales lead. Using the lead id from the URL…
backdesk
  • 1,781
  • 3
  • 22
  • 42
0
votes
1 answer

Passing Props to Reflux store?

Is it possible/advisable to pass props to a Refluxjs store? I'm refactoring some existing code that takes an API path as one of it's parameters. My JSX looks like this:
Broonix
  • 1,135
  • 2
  • 11
  • 26
0
votes
1 answer

How to setState to one particular component instance in RefluxJS?

I'm currently doing one small project in React + Flux (RefluxJS) and I faced wit one issue I can't solve. I would be very gratefully if someone of you can give me a hand. Here you have the link to GitHub with the whole project in order to facilitate…
Yonirt
  • 165
  • 2
  • 2
  • 11
0
votes
1 answer

React.render() not rendering component

I'm trying to get my head around React, Reflux and JSX. I have a simple file I'd like to try and get working.
Julio
  • 2,261
  • 4
  • 30
  • 56
0
votes
1 answer

Reflux listenAndPromise do action many times

i have some actions in reflux actions, this is my actions var BeritaActions = Reflux.createActions({ 'getListBerita': { children: [ 'actions', 'completed', 'failed' ] }, 'getBerita': { children: [ 'actions',…
yussan
  • 2,277
  • 1
  • 20
  • 24
0
votes
0 answers

Triggering an action from a store or accessing a store inside an action

I am building a test application using reactjs and refluxjs where I show a list of images from an API with pagination. Currently I have one PicturesStore and two actions: RefreshAction and PageChangeAction. The filters for filtering the images that…
Edgar Santos
  • 73
  • 1
  • 4
0
votes
1 answer

Is having Store getters with Promise an anti-pattern in Reflux

I'm getting into reflux and am embracing the single direction flow. That said, I'm struggling with the idea of Components having to fire an action just to get data from the store. This is in a lot of examples I have seen, but it seems odd when…
Blaine Garrett
  • 1,286
  • 15
  • 23
0
votes
1 answer

Why is the store did not see action in reflux?

I get the following error actions.toggleMenu is not a function I create a action module.exports = Reflux.createAction([ 'callAi', 'logout', 'fullScreen', 'toggleMenu', 'showSidebar' ]); I create this store actions =…
ZPPP
  • 1,567
  • 2
  • 18
  • 27
0
votes
1 answer

Reflux - Multiples actions in the same view

I'm pretty new using reactjs & reflux and I have no idea how to implement the next situation: I have a view with some tabs, each tab is going to have different data coming from an API. So far what I have done is the code below: My Component: import…
gon250
  • 3,405
  • 6
  • 44
  • 75