2021-03-31 11:21:06 +02:00
|
|
|
import {Subject} from "rxjs";
|
|
|
|
|
|
|
|
interface EmoteEvent {
|
|
|
|
userId: number,
|
|
|
|
emoteName: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
class EmoteEventStream {
|
|
|
|
|
|
|
|
private _stream:Subject<EmoteEvent> = new Subject();
|
|
|
|
public stream = this._stream.asObservable();
|
|
|
|
|
|
|
|
|
2021-05-21 16:25:12 +02:00
|
|
|
fire(userId: number, emoteName:string) {
|
2021-03-31 11:21:06 +02:00
|
|
|
this._stream.next({userId, emoteName});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const emoteEventStream = new EmoteEventStream();
|