4 ms·
is this different from the observer pattern? which languages do you program in?
by era86 14y ago
is this different from the observer pattern? which languages do you program in?
- jarek-foksa 14y agoI'm not aware of the observer pattern. I'm using CoffeeScript and my implementation of pub/sub is here https://gist.github.com/4489352 https://gist.github.com/4489352 Sample usage: button = toggleOn: -> @trigger 'toggled', 'on' window = init: -> button.listen 'toggled', (buttonState) => @showWindow if buttonState is 'on'