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

[Promise] Y.batch should accept and flatten nested arrays #740

Closed
ericf opened this issue May 12, 2013 · 4 comments
Closed

[Promise] Y.batch should accept and flatten nested arrays #740

ericf opened this issue May 12, 2013 · 4 comments
Assignees

Comments

@ericf
Copy link
Member

ericf commented May 12, 2013

Y.batch() would be much more useful if it accepted arguments which were arrays as well. It could take its arguments and flatten any arrays into one array using Y.Array.flatten()

@ghost ghost assigned juandopazo May 12, 2013
@juandopazo
Copy link
Member

At #670 we're working on deprecating Y.batch in favor of Y.Promise.every which takes an array.

@juandopazo
Copy link
Member

I was hoping to leave Y.Promise.every as an implementation of the DOM standard, and I don't see the DOM flattening arrays. I think the most compelling reason to flatten would be, in the case of batch, to be able to pass multiple arguments and alternatively an array, just like use() does. But since Promise.every only takes an array it seems unnecessary to flatten. What do you think?

@lsmith
Copy link
Contributor

lsmith commented May 16, 2013

-1 to flattening. Follow the emerging spec. Devs can flatten the input array if they need to.

This was referenced May 16, 2013
@ericf
Copy link
Member Author

ericf commented Jul 11, 2013

Yeah that's fine, I didn't realize there was a spec emerging for this. I can use Y.Array.flatten() when I hit this.

@ericf ericf closed this as completed Jul 11, 2013
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

3 participants