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

Sort plugin excludes batchNum; Maybe fires unnecessary events #1707

Closed
akagomez opened this issue May 22, 2015 · 1 comment
Closed

Sort plugin excludes batchNum; Maybe fires unnecessary events #1707

akagomez opened this issue May 22, 2015 · 1 comment
Assignees
Milestone

Comments

@akagomez
Copy link
Contributor

can.batch.start();
listB.push({ id: 'a' });
listB.push({ id: 'a' });
listB.push({ id: 'a' });
can.batch.stop();
"// BATCHED; SORTED..."
"    Sorted..." // <-- Upon creating the list
"    Sorted..." 
["type:", "length", "batchNum:", undefined]
["type:", "length", "batchNum:", 9] // <-- This event caused the sort
"    Swapped? 1, 2"
["type:", "length", "batchNum:", undefined]
["type:", "length", "batchNum:", 9] // <-- This event caused the swap
["type:", "length", "batchNum:", 9]

The Sort plugin fires events like length, add, reset, etc. for can.view.live.list and does nothing to pass along the original batchNum that instigated the work.

Since the current Sort plugin is derived from the previously incomplete Sort plugin, those events were left in/adapted. I'm curious to know if we can do without them all together.

http://jsbin.com/poduxa/6/edit?js,console

@daffl
Copy link
Contributor

daffl commented Oct 22, 2015

Closed via #1718

@daffl daffl closed this as completed Oct 22, 2015
@daffl daffl added this to the 2.3.0 milestone Oct 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants