I have a socket event called "names"
and the data is
data : {
action : "UPDATE" /"CREATE" /"DELETE"
payload: {....}
}
now I have 3 subjects and 3 observable and I do smth like:
switch (){
case : "UPDATE"
this.updateSubject.next(val)
case : "CREATE"
this.updateSubject.next(val)
case : "DELETE"
this.updateSubject.next(val)
}
How can I achieve that in a better way? I tried with FromEvent(socket, 'names')
but I still need 3 subjects and 3 observables
thx