Closed pvamshi closed 10 months ago
Disclaimer: Coming from Angular world 😁!
In libraries like NgRx, NgXs effects we always return an observable. I feel this code snippet
store .on('today') .pipe( debounce(100) ) .subscribe(async date => { let users = await api.get({ since: date }) store.set('users')(users) })
can be
store .on('today') .pipe( debounce(100), mergeMap( date => { return api.get({since: date}) }), map( users => ({users}) )
I did not put much thought into the syntax. I will try to test this and give you the results. For now, sharing this idea here.
Disclaimer: Coming from Angular world 😁!
In libraries like NgRx, NgXs effects we always return an observable. I feel this code snippet
can be
I did not put much thought into the syntax. I will try to test this and give you the results. For now, sharing this idea here.