Skip to content

Instantly share code, notes, and snippets.

@alyssaBiasi
Last active August 19, 2016 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alyssaBiasi/0f94d0f44daa1cb47f5323848d7a576d to your computer and use it in GitHub Desktop.
Save alyssaBiasi/0f94d0f44daa1cb47f5323848d7a576d to your computer and use it in GitHub Desktop.
REA Flux to Redux "The Realisation" - http://rea.tech/singletons-suck-aka-flux-to-redux/

It's not the cookies!! \o/

TL;DR: The flux stores are not being initialised on every request.

First request to the server:

request cookies:  {}
params:  {}
toggles:  {}

Second request (turning on a toggle via the query parameter):

request cookies:  { }
params:  { featureA: 'true' }
toggles:  { featureA: true }

A new client comes along:

request cookies:  {}
params:  {}
toggles:  { featureA: true }

THE TOGGLE IS STILL SET!

The request with the toggle sets the state in the FeatureToggleStore... which is being shared between each request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment