react-observer-pattern
v1.0.2
Published
A Node.js module that implement the observer pattern in react
Downloads
13
Readme
react-observer-pattern
A Node.js module that implement the observer pattern in react
Installation
npm install react-observer-pattern --saveUsage
TypeScript
import { Observer, IObserver } from 'react-observer-pattern';
export class test implements IObserver {
ReceiveNotification(message: any): void {
console.log(message);
}
constructor(){
Observer.GetGlobalInstance().RegisterObserver("key", this);
}
}Observer.GetGlobalInstance().NotifyObservers("key", "message");This sample show you :
- How to bind to a specific key
- How to send an information to a specific key
