Questions tagged [flux]

An application design paradigm used as a replacement for MVC, pioneered at Facebook by Jing Chen

Flux is an application design paradigm used as a replacement for the more traditional pattern.

It complements React's composable view components by utilizing a unidirectional data flow. It's more of a pattern rather than a formal framework, and you can start using Flux immediately without a lot of new code.


Popular implementations :

1614 questions
22
votes
4 answers

Getting router params into Vuex actions

I would like to pass router params into Vuex actions, without having to fetch them for every single action in a large form like so: edit_sport_type({ rootState, state, commit }, event) { const sportName = rootState.route.params.sportName <------- …
softcode
  • 4,358
  • 12
  • 41
  • 68
21
votes
4 answers

Flux Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch

My code https://gist.github.com/ButuzGOL/707d1605f63eef55e4af So when I get sign-in success callback I want to make redirect, redirect works through dispatcher too. And I am getting Dispatch.dispatch(...): Cannot dispatch in the middle of a…
ButuzGOL
  • 1,233
  • 2
  • 13
  • 27
20
votes
5 answers

Redux - Loading initial state asynchronously

I'm trying to work out the cleanest way to load the initial state of my Redux stores when it comes from API calls. I understand that the typical way of providing the initial state is to generate it server-side on page load, and provide it to Redux…
Graham
  • 4,095
  • 4
  • 29
  • 37
20
votes
1 answer

How to fire periodic actions using setTimeout and dispatcher in redux

How/Where can I dispatch actions periodically? Using recursive setTimeout to make a countdown. Taken from the example, something similar to this: // Can also be async if you return a function export function incrementAsync() { return dispatch =>…
eguneys
  • 6,028
  • 7
  • 31
  • 63
19
votes
2 answers

REST (HATEOAS) and ReactJS

I'm interested in using the HATEOAS principle of REST to reduce business logic in a SPA application. In a React-specific context, I'd like to know if there are challenges that make this impractical and, if not, what is a good strategy to…
Brent Arias
  • 29,277
  • 40
  • 133
  • 234
19
votes
2 answers

Redux state persistence with a database

From the discussion here it seems that the state of Redux reducers should be persisted in a database. How does something like user authentication works in this instance? Wouldn't a new state object be created to replace the previous state in the…
hoodsy
  • 894
  • 2
  • 11
  • 19
18
votes
1 answer

How to cancel/ignore an action in redux

Is there a way to cancel an action or ignore it? Or rather what is the best/recommended way to ignore an action? I have the following action creator and when I input an invalid size (say 'some_string') into the action creator, in addition to getting…
Stoikerty
  • 671
  • 1
  • 7
  • 16
18
votes
1 answer

A Store of Actions for optimistic updates is a good approach in Redux/Flux?

I've been working with optimistic updates in a React+Flux application and saw two things: What happens if a user attempts to close the window when exists some uncompleted actions. For example in Facebook, a message appears in the wall even if…
gabrielgiussi
  • 9,245
  • 7
  • 41
  • 71
16
votes
2 answers

Options for State Management in Blazor

What libraries/techniques are available in Blazor for State management for webassembly (wasm). It would be nice to know pros and cons of different approaches.
Neil
  • 7,482
  • 6
  • 50
  • 56
16
votes
2 answers

Why should I keep the state flat

I'm using ReactJs with Redux and on some tutorials and codes I see people suggesting and using normalizr to keep the state flat. But what is the real advantage in keeping it flat ? Will I encounter any problems if I don't ? Is it necessary ?
Mani Shooshtari
  • 760
  • 1
  • 6
  • 19
16
votes
4 answers

React: Are there respectable limits to number of props on react components

At times I have components with a large amounts of properties. Is there any inherent problem with this? e.g. render() { const { create, update, categories, locations, sectors, workTypes, organisation } = this.props; // eslint-disable-line…
AndrewMcLagan
  • 13,459
  • 23
  • 91
  • 158
16
votes
2 answers

Javascript Redux - how to get an element from store by id

For the past weeks I've been trying to learn React and Redux. Now I have met a problem thay I haven't found a right answer to. Suppose I have a page in React that gets props from the link. const id = this.props.params.id; Now on this page, I'd…
Kethmar Salumets
  • 185
  • 1
  • 1
  • 7
16
votes
3 answers

is there any good Http library for React flux architecture

We have a react application with Flux architecture, I am searching any good library for sending http request like angular's $http, $resources.
Vinoth Rajendran
  • 1,181
  • 1
  • 13
  • 28
15
votes
2 answers

Difference between Infinite Java Stream and Reactor Flux

I am trying to figure out the conceptual differences between an infinite Stream and an infinite Flux respectively (if there are any). For that matter, I have come up with the following examples for an infinite Stream/Flux @Test public void…
Felix
  • 171
  • 1
  • 5
14
votes
2 answers

what is this difference between this flux action and this function call?

I could a have a flux action like this: {type: 'KILL', payload: {target: 'ogre'}} But I am not seeing what the difference is between having a method on a class People (wrapping the store) like this, People.kill('ogre') IF People is the only…
Mitch VanDuyn
  • 2,838
  • 1
  • 22
  • 29