A bare function to notify observers. The incredibly cheap implementation of the observer pattern.
Use along with the utility type definition Observer.
The iterator of observers
const observers = new Set<Observer<string>>();observers.add( ( text ) => console.log( text ) );observers.add( ( text ) => alert( text ) );notifyObservers( observers, 'wenis' ); Copy
const observers = new Set<Observer<string>>();observers.add( ( text ) => console.log( text ) );observers.add( ( text ) => alert( text ) );notifyObservers( observers, 'wenis' );
The param you want to give to observers
A bare function to notify observers. The incredibly cheap implementation of the observer pattern.
Use along with the utility type definition Observer.