Skip to content

koehrlenguillaume/Observer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-observer-pattern

A Node.js module that implement the observer pattern in react

Installation

npm install react-observer-pattern --save

Usage

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published