description export class Barrier < T > { private promise : Promise < T > ; private resolve : ( ( value : T ) => void ) | undefined ; constructor ( ) { this . resolve = undefined ; this . promise = new Promise < T > ( ( resolve ) => { this . resolve = resolve ; } ) ; } public set ( data ) { this . resolve ?. ( data ) ; } public get ( ) { return this . promise ; } }