-
Notifications
You must be signed in to change notification settings - Fork 0
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
Method for syncing emitters #3
Comments
ryanve
added a commit
that referenced
this issue
May 3, 2014
When I've used this technique, |
ryanve
added a commit
that referenced
this issue
May 3, 2014
ryanve
added a commit
that referenced
this issue
May 3, 2014
I released 0.4.0 with static and instance forms of var f = energy.to(function() {
f.emit('started')
// ...
f.emit('ended')
}).on('ended', function() {
console.log('ended!')
})
// later
f() Or use an var f = function() {
f.emit('called')
}
energy().to(f)
f.on('called', function() {
console.log('called!')
})
// later
f() |
ryanve
added a commit
to ryanve/ux
that referenced
this issue
May 3, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've needed several times a convert a function into a emitter like this. I want to add a method to accommodate this. It would allow plain objects or functions to be made emitter-like by receiving properties (and methods) from the source emitter and thus would share listeners with the source.
My original concept was for the method was
emitter.into(target)
or staticenergy.into(target)
but due to this shared data perhapsemitter.sync(target)
oremitter.share(target)
is clearer.The text was updated successfully, but these errors were encountered: