I am making a pub/sub object for custom events and I can’t figure how to add support for events like user.logged.* where it would subscribe the subscriber to the events user.logged.in and user.logged.out
Are there any resources cause Google can’t help.
EDIT
Maybe in my subscribe function i should check the passed event type for wildcards and subscribe to both events?
I would constraint it to just the last part be a wildcard. Then,
triggerwould look likeOn this examble, you would do
Then, you could register the events
user,user.loggedanduser.logged.in. And would effectively get a event hierarchy. With the rest of the event passed to the handler you could maybe do fun things too…