Examples
Paint
Playground | Repository | Demo
Complexity: Medium
Basic painting application that demonstrates how to write logics declaratively by composing actions and scenarios. It is also a proof that Awai works great with real-time actions.
Todo list
Complexity: Simple
Traditional Todo list example, which shows simple actions and state usage. In contrast to the Paint example, logics are handled inside of actions, not in scenarios, which is a good approach for simple projects.
Safe counter
Complexity: Simple
Uses: State, Selector, Action, Scenario
Funny counter application, which prevents user from keeping counter below 0, by automatically incrementing counter every second. Project demonstrates scenarios composition and how additional logics may be handled outside of actions.
Debounced counter
Complexity: Simple
Used nodes: State, Action, Scenario
Project that demonstrates how to implement debouncing using forked scenario.
Throttled counter
Complexity: Simple
Used nodes: State, Action, Scenario
Project that demonstrates how to use cyclic scenario for implementing throttling functionality.
Persist state
Complexity: Simple
Used nodes: State, Scenario, Registry
Project that demonstrates how to persist state in localStorage, and implement shared Awai nodes functionality using Registry.
User polling
Complexity: Complex
Uses: State, AsyncState, Action, Selector, Scenario, Effect
Project that demonstrates how to perform user polling with different frequency depending on connection speed. In order to test this example, open DevTools and throttle your network connection.
Universities search
Complexity: Complex
Used nodes: State, AsyncState, Action, Selector, Scenario
Project that demonstrates how to implement debounced search with sorting. It shows advanced Scenario and AsyncSelector usage. It also features error and loading states handling.