This repository was archived by the owner on Feb 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
[Deprecated] Architecture
Vojta Smrcek edited this page Sep 7, 2018
·
1 revision
General diagram of the FluxC architecture:

The dispatcher is the central piece of communication between the app, stores and network clients. It acts like an event bus (it's currently just an event bus wrapper).
Notes:
- WP REST API client is not implemented yet (we have a proof of concept and discovery utils).
- Memory storage is optional, it makes sense to have some data in memory so we don't have to hit the DB everytime we call a Store's getter. The Account Store is currently the only Store using data stored in memory.
An app based on FluxC communicates via different channels:
- App sends actions. Actions are interpreted by one or multiple Stores.
- Stores generate events. Some events might be observed by the app.
- App gets data from Stores.
Example:
- App asks FluxC to
FETCH_SITEfor site X. The SiteStore is listening for thisFETCH_SITEaction, will trigger a call to the XMLRPC or REST client depending of site X. - Network client receive a response from the server and notify the SiteStore. The SiteStore updates the site in the DB and generates an
OnSiteChangedevent. The app is listening forOnSiteChangedevents. - App gets updated site by calling the
getSiteByLocalId()getter on the SiteStore.