Skip to content

Conversation

@jonathantneal
Copy link
Member

stmt.media = joinMedia(media, stmt.media || [])
return Promise.resolve(statements).then(function(stmts) {
return stmts.reduce(function(promise, stmt) {
return promise.then(function() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but perhaps we should have a comment here to explain that this cleverness works on the array in series.

Copy link
Member Author

@jonathantneal jonathantneal May 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ll add a comment. I’m actually glad to see the reduce and then terminology used here instead of each, because each did not make me aware that this was processing the statements in “synchronous” sequence.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

- Resolves #275
- Removes any-promise subdependency
- Removes runtime assert from promise-each
@RyanZim RyanZim merged commit 1389208 into postcss:master May 10, 2017
@RyanZim
Copy link
Collaborator

RyanZim commented May 10, 2017

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants