createEvent
Method for creating an event
Arguments
name
? (string): Event name
Returns
Event: New event
#
NotesEvent - 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)
#
Example 1We 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.