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 SetState Race Condition using Promise.all

componentDidMount() { Promise.all([OfferCreationActions.resetOffer()]).then( () => { OfferCreationActions.updateOfferCreation('viewOnly', true); OfferCreationActions.updateOfferCreation('loadingOffer', true); …
SRoseDev88
  • 184
  • 6
0
votes
1 answer

Why do I receive an error stating onAuth is not a Function?

I'm an app to fit the new firebase SDK. It compiles not problem but app will not display as I receive an error via console that stats onAuth is not a function I've been through the upgrade process here:…
0
votes
1 answer

creatreactapp & Reflux TypeError: Super expression must either be null or a function

I have a simple createreactapp that I want to test reflux with, instead of redux, and I'm trying to include Reflux into it. I checked the spelling of .Component and .Store and class structure but still. When I run it it gives me this…
snicks
  • 77
  • 5
0
votes
1 answer

Reflux Action Not Reaching Method

I have build a store with actions like below: import Reflux from 'reflux' export const AuthActions = Reflux.createActions(['updateAuth', 'otherThing']) export class AuthStore extends Reflux.Store { constructor() { super() this.state =…
steventnorris
  • 5,656
  • 23
  • 93
  • 174
0
votes
1 answer

Action creators in Reflux ( Handle multiple actions in Reflux )

Alright, Reflux author says he has removed dispatcher to integrate the same in action itself and how much he hates comparing string and type comparision ( assuming - for different action differentiation) I just was in need to add multiple actions…
HalfWebDev
  • 7,022
  • 12
  • 65
  • 103
0
votes
2 answers

react component state does not reset on subsequent call for same component

So my Component looks something like this as mentioned below. When the component is rendered for the first time, it sets the state. But for the 2nd call, the props hold new data but it never sets the state.Instead, the state has previous data.Not…
HappyDeveloper
  • 143
  • 1
  • 14
0
votes
0 answers

How does one await the completion of a task or suspend a method in a component?

I am using a third party library that renders some UI. The api has a callback function so one can run necessary code before invoking the next UI change in the third party library. In my scenario, I perform a user action (clicking a button), the…
Nick
  • 1
  • 1
0
votes
0 answers

What is the proper way to issue a redirect from a ReactJS / Reflux component?

I have an Actions class created via Reflux.createActions(), a Store class which extends Reflux.Store (ES6-style), and a Component which extends Reflux.Component. The component is effectively just a simple
soapergem
  • 9,263
  • 18
  • 96
  • 152
0
votes
1 answer

ReactJs : listenAndPromise is not a function

My project file structure App.jsx import React, { Component } from 'react'; import createBrowserHistory from 'history/lib/createBrowserHistory'; import { Router, Route ,browserHistory} from 'react-router'; import Header from…
Vivek Iyer
  • 154
  • 1
  • 6
  • 16
0
votes
2 answers

React reflux createStore $ajax trigger doesnt working

Hi I'm trying to get data updated with trigger but it dosn't working I'm new at react and reflux my part of code is: import Reflux from 'reflux' import $ from 'jquery' import PeopleActions from '../actions/PeopleActions.js' let PeopleStore =…
0
votes
1 answer

How to get a list of all Reflux actions names and a preEmit hook for all of them?

I know using Reflux.__keep.createdActions I get a list of all actions created. Is there a way to know the name of these actions? Is there a way to define a preEmit hook for all actions?
Allen Bargi
  • 14,674
  • 9
  • 59
  • 58
0
votes
1 answer

Reflux: How to listen to a subset of actions using `listanables` or `this.listenToMany`?

Imagine that you have a huge actions object and some components / stores just want to listen subset of it. var actions = Reflux.createActions({ /* lots of actions with children*/}); How to listen only for a subset of these action and not do…
FelikZ
  • 2,976
  • 4
  • 32
  • 41
0
votes
1 answer

How to trace error in react native in reflux?

how can i trace this error? screen here I can find 'apply' property in my code. Thanks for the help! I found error by commenting every function onLoadUser: function (user) { Actions.loadUser.completed(user); // at this place catch error }, …
ImPuLsE
  • 173
  • 1
  • 2
  • 9
0
votes
1 answer

Using OrderedMap.merge to translate Objects to OrderedMaps instead of Maps?

I'm trying to use OrderedMap.merge to store application state using reflux (specifically reflux-immutable), but I noticed this does not translate Objects into OrderedMaps, but regular Maps, which do not guarantee order when iterated over. There are…
James Pizzurro
  • 365
  • 1
  • 3
  • 10
0
votes
1 answer

ReactJS render() method called more often than necessary in complex RefluxJS application

I have a RefluxJS application which has several stores and a pretty deep component hierarchy. I've tried to make the components very independent, with each connecting to the stores it needs to render; and the stores themselves sometimes call…
jon without an h
  • 572
  • 1
  • 4
  • 17