- Getting Started
- Dojo local installation
- Your first Dojo application
- Components of a Dojo application
- Creating widgets
- Responding to events
- Form widgets
- Deploying to production
- Advanced
- Theming
- Web Animations
- State management
- Dojo Stores
- Form validation
- Registry
- Routing
- Setting up a development environment
- Data-driven widgets
Tutorials
Dojo Stores
Overview
Modern web applications are often required to manage complex state models which can involve fetching data from a remote service or multiple widgets requiring the same slices of state. While Dojo’s widgets can manage application state, encapsulation and a clean separation of concerns may be lost if widgets manage their own visual representations, listen for interactions from the user, manage their children, and keep track of state information. Additionally, using widgets to pass state through an application often forces the widgets to be aware of state information for the sole purpose of passing that data down to their children. To allow widgets to remain focused on their primary roles of providing a visual representation of themselves and listening for user interactions, Dojo Stores provides a mechanism using the Registry
and StoreProvider
, that is designed to coordinate an application’s external state and connect and map this state to widget properties.
In this tutorial, we will start with an application that is managing its state in the widgets themselves. We will then extract all of the state-related code out of the widgets to be managed within a Dojo store using commands
, processes
and the StoreProvider
.
You can open the tutorial on codesandbox.io or download the demo project and run npm install
to get started.
Prerequisites
This tutorial assumes familiarity with dojo and the beginner tutorial series content.
What is Dojo Stores
##
Dojo Stores is
Summary
Since Dojo widgets are TypeScript classes, they are capable of filling a large number of roles, including state management. With complex widgets, however, combining the responsibilities to manage the widget’s visual representation as well as the state of its children can make them difficult to manage and test. Dojo Stores coupled with the Registry
and StoreProvider
provide mechanisms to externalize and centralize an applications state.
If you would like, you can open the completed demo application on codesandbox.io or alternatively download the project.
- Getting Started
- Dojo local installation
- Your first Dojo application
- Components of a Dojo application
- Creating widgets
- Responding to events
- Form widgets
- Deploying to production
- Advanced
- Theming
- Web Animations
- State management
- Dojo Stores
- Form validation
- Registry
- Routing
- Setting up a development environment
- Data-driven widgets