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

more efficient ref.on and ref.off #17

Open
scien opened this issue Jun 3, 2014 · 0 comments
Open

more efficient ref.on and ref.off #17

scien opened this issue Jun 3, 2014 · 0 comments
Assignees

Comments

@scien
Copy link
Contributor

scien commented Jun 3, 2014

current refs keep an array with each event

events:
  type: [handler1, handler2]

ref.off 'value' isn't called until events[type] is empty. when we could do ref.off 'value', handler1 and stop receiving those events immediately.

note this only affects refs with two listeners.

i think all of my code avoids this anyway by using multiple refs

document.get('property').on 'value', handler1
document.get('property').on 'value', handler2

which would then use separate refs and this would be a non-issue

@scien scien self-assigned this Jun 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant