Skip to content

Instantly share code, notes, and snippets.

@zurgl
Last active December 3, 2021 16:07
Show Gist options
  • Save zurgl/1a7a1360596f37c3574bda11ada072a9 to your computer and use it in GitHub Desktop.
Save zurgl/1a7a1360596f37c3574bda11ada072a9 to your computer and use it in GitHub Desktop.

Migrate all Pathways to the new reducer

Description

The state of the application is managed by plain Javascript Object: we refer to it as the global state. It’s dedicated to:

  • Keep track of the completion of the pathways by the user.
  • Keep track of the state variable defined at the protocol level.
  • Store the defined metadata required by each protocol
  • Allow the UI to trigger the right event when needed.

The reduced is a write-only function acting on the global state. A set of separate function define an read-only interface

This issue aims to rewrite the reducer and simplify the set of read-only functions. All the protocol and react components were impacted by these changes then it's required to migrate all the code and re-test all the pathways.

Related issue on Jira:

Parents issue

  • LEARN-4:

Children:

Why have we done this ?

To simply code readibility and future maintenance of the application

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