mikehostetler / amplify

AmplifyJS
http://amplifyjs.com
GNU General Public License v2.0
1.45k stars 143 forks source link

Subscribe to event groups (namespaces) #109

Open bennycode opened 9 years ago

bennycode commented 9 years ago

Hi, I am using amplify.store and it's great! But it could become even better, if it would be possible to subscribe to multiple events by using namespace patterns. For example: If want to get notified about a.b.c and a.b.d just by subscribing to a.b. Is this possible?

Here is the code (CoffeeScript) I am running which shows that is not possible at the moment.

amplify.subscribe 'app.feature', ->
  console.log 'Unfortunately I will not be notified :('

amplify.subscribe 'app.feature.event1', ->
  console.log 'I will get notified'

amplify.publish 'app.feature.event1'
amplify.publish 'app.feature.event2'