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

Proposal in Progress: Standardizing events #4656

Open
justinbmeyer opened this Issue Dec 6, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@justinbmeyer
Copy link
Contributor

justinbmeyer commented Dec 6, 2018

Currently, CanJS has too many ways of listening to events. .on, onKeyValue, onEvent, onPatches, etc. Also I'd like to take destructuring into account ...

I'd like to consolidate this and simplify for CanJS 6. Everything will consolidate to an event object:

So instead of:

mAP.on("name", function(ev, newName, oldName){
	console.log(arguments);
});

Everything will be on the event object:

map.on("name", function( {value, oldValue, type} ) { ... })

There will be no more event, newValue, oldValue arguments . This is a breaking change, but I think we can move people to it.

@justinbmeyer justinbmeyer changed the title Proposal: Work in Progress: Standardizing events Proposal in Progress: Standardizing events Dec 6, 2018

@frank-dspeed

This comment has been minimized.

Copy link
Contributor

frank-dspeed commented Dec 12, 2018

@justinbmeyer can we make please this interface? with subscribe and unsubscribe?

https://github.com/tc39/proposal-observable

@justinbmeyer

This comment has been minimized.

Copy link
Contributor

justinbmeyer commented Dec 12, 2018

@frank-dspeed please create another issue for that. I think something like that can be created on-top of CanJS's symbols APIs, but it can't be the underlying primitive CanJS uses without too many breaking changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment