Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal to add wildcards / channel names to hooker.register #13

Open
gaurav21r opened this issue Oct 14, 2015 · 0 comments
Open

Proposal to add wildcards / channel names to hooker.register #13

gaurav21r opened this issue Oct 14, 2015 · 0 comments
Labels

Comments

@gaurav21r
Copy link
Member

Wildcard Support

Rough API

Due to popular demand, it has been requested that we add wildcards to hooker.register() as follows:

hooker.register('a/*', function (data){

});

hooker.register('a/b/*', function (data){

});

hooker.trigger('a/b/c', data);
hooker.trigger('a/d/c', data);

Implementation guide

Long term vision

We would like to use an existing router framework to achieve this. Maybe pull out the routing from express?

Short term

The short terms solution is that for every trigger we run through our entire object of routes and fire those handlers which match our wildcard via regular expressions.

This is a HUGE performance problem as the number of keys increase, but shoudl do for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant