Stores

Stores manage the application state by taking control of the data within your application, which means stores manage the data, data retrieval methods, dispatcher callbacks, and so on.

For a better understanding, refer to the following diagram:

Now that we have defined our dispatcher, next, we need to identify the subscriber's for the change provided by the dispatcher.

Create a separate directory in stores in the static directory, which will contain all the store definitions.

Let's create a TStore file that will subscribe to any changes emitted by the dispatcher. Add the following code to the TStore file which does so:

 import AppDispatcher ...

Get Cloud Native Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.