Creates an Event. In other words you create intention.
You can pass
name if you want.
name? (string): Event name.
Event: New event
Event - it is a function which allows to change state when called, see Example 1, also it can be a good way to extract data, see Example 2 and we will discuss it the next section.
Let's talk about what happened. We created a store and an event (addNumber), and started watching the store.
Notice the function call
addNumber(10). Whenever you will call
addNumber(10), you can look at the console and see how state changes.