Skip to main content

Observer

The Observer class is designed to create subscribable instances by invoking the method subscribe

// ./src/observers/counter.js
import { Observer } from "hermes-io";
export const CounterObserver = new Observer();

The CounterObserver is designed to manage the increment and decrement, here is an example to illustrate: counter application demo

generate observer (optional)

To simply things you can generate the observer by using hermes-io-cli

hermes-io-cli --root="./src" --observer="CounterObserver"