i have 2 observables:
- an observable representing list of checkbox inputs.
- an observable representing stream of events coming server.
i'd filter second observable using values first one.
the values received server include tag property, corresponds values in checkbox list. observable resulted combination of above 2 yield values server tag property included in set of ticked checkboxes.
you can use withlatestfrom.
.
source.withlatestfrom(checkboxes, (data, checkbox) => ({data, checkbox})) .filter(({data, checkbox}) => ...) here, checkboxes observable representing list of checkbox inputs. source observable representing stream of events coming server. in filter function can check if data valid compared checkbox settings , let trough.
notice important checkboxes emits @ least 1 value before stream can emit anything.
ps. in regard other answers, solution works if source cold.
Comments
Post a Comment