Skip to content

Commit

Permalink
Merge pull request #12 from bluzi/master
Browse files Browse the repository at this point in the history
One-time events
  • Loading branch information
Bougarfaoui El houcine authored Aug 6, 2017
2 parents cd4fd38 + d1450cd commit 80284ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion socket-io.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,9 @@ export class WrappedSocket {
};
}).share();
}


/* Creates a Promise for a one-time event */
fromEventOnce<T>(eventName: string): Promise<T> {
return new Promise<T>(resolve => this.once(eventName, resolve));
}
}

0 comments on commit 80284ce

Please sign in to comment.