0

Here's what I'm trying to do---add a listener to a fluxible event to do an ajax call. In Redux, this is called a side effect and there are several ways of doing this (ex: create "side effects" using redux-saga, which are just listeners that do stuff). In Flux, one approach is to do side effects in the Store.

What about fluxible?

From what I can tell, the way to do this is in the Store. But I don't see a way to get the context. So perhaps there's another way to do this?

U Avalos
  • 6,538
  • 7
  • 48
  • 81

1 Answers1

0

You should do ajax call in action. Action receives context, where you could provide plugin to do http call. Stores should contain only application state and have only synchronous code.

Tomas Kirda
  • 8,347
  • 3
  • 31
  • 23