ryardley / ts-bus

A lightweight JavaScript/TypeScript event bus to help manage your application architecture.
MIT License
137 stars 8 forks source link

useBusReducer pass in subscriber filter #15

Open dmicic opened 5 years ago

dmicic commented 5 years ago

Would be nice to have the option to pass in purely a filter string or maybe a array into the useBusReducer

const state = useBusReducer(initial, reducer, "auth.signin.**"));

instead of

const state = useBusReducer(initial, reducer, (dispatch, bus) => bus.subscribe("auth.signin.**", dispatch));

for custom subscriber.

ryardley commented 5 years ago

This is also related to the proposed breaking changes here: https://github.com/ryardley/ts-bus/issues/18#issuecomment-528875878

ryardley commented 4 years ago

Is this ok to close?