Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save akaztp/e56e851ecc472e7ae398970d49270fe7 to your computer and use it in GitHub Desktop.
Save akaztp/e56e851ecc472e7ae398970d49270fe7 to your computer and use it in GitHub Desktop.
Epics outline for case study on article "Web app architecture based on Redux".
  • React only on any action of types:
    • Selection of an entry. An entry was just selected so we should try to load its data.
    • User login success. Since an entry may be selected but not a user, only after the user is ok we can try to load the entry.
    • Page load. Similar to the user login check. Only on the correct page we can load the entry.
  • React only on these pre-condition:
    • Correct page id
    • user logged in
  • If current selected entry id is null:
    • Chain an action setting editing status to READY
    • Set editing data to empty
    • End the epic
  • If current editing state is CHANGED:
    • No action. User is the middle of changing something so do not load an entry.
    • End the epic
  • If current selected entry id and user id are both non null:
    • Ask the data layer to start the load of the corresponding entry
    • Chain an action setting editing status to LOADING
    • When having the database result:
      • Chain an action setting editing status to READY
      • Chain an action setting editing data to the data received
      • End the epic
@akaztp
Copy link
Author

akaztp commented Sep 27, 2017

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