📄️ Observer
The Observer class is designed to create subscribable instances by invoking the method subscribe
📄️ Context
The Context class is designed to create notification context, only notifications submitted within a specific context will be listened, others will be ignored, you can think on this as a whitelist, this context constrains the observer by telling which notifications must listen to.
📄️ useObserver
The useObserver hook integrates the Observer and Context, this can be used to subscribe listeners and receive notifications under certain constraints provided by the notification context.
📄️ notify
Method to send notifications to the subscribers of a specific Observer signed with a Context that way we create a notification context, let's see this in details:
📄️ withNotify
The withNotify HOC allows access to the notify method in a simple way:
📄️ Example
Let's try the previous concepts to build a simple counter application: