UNPKG

httpgd

Version:

R httpgd GraphicsDevice API and connection handler

21 lines (20 loc) 522 B
/** * Simple implementation of a generic state change listener. Keeps track of the * previous state. */ export declare class StateChangeListener<T> { private fun; private oldState?; /** * Notify subscribers of state change. * * @param newState New state. */ notify(newState: T): void; /** * Listen to state changes. * * @param fun Function to be called on state changes. */ subscribe(fun: (newState: T, oldState?: T) => void): void; }