Skip to content

allow async getJSON (& adapt saveJSON)#59

Merged
madyankin merged 1 commit intomadyankin:masterfrom
flying-sheep:getJSON-promise
Apr 30, 2017
Merged

allow async getJSON (& adapt saveJSON)#59
madyankin merged 1 commit intomadyankin:masterfrom
flying-sheep:getJSON-promise

Conversation

@flying-sheep
Copy link
Copy Markdown
Contributor

why not go the whole way with promises?

this way we don’t force people (e.g. me 😛) to use sync variants of IO functions.

src/saveJSON.js Outdated
writeFile(
`${ cssFile }.json`,
JSON.stringify(json),
e => e ? reject(e) : resolve());
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

It can be useful to resolve the promise with the received json. Could you please make this?

@madyankin
Copy link
Copy Markdown
Owner

@flying-sheep, great! I'll merge this today or tomorrow (on my phone right now). Thank you!

@madyankin
Copy link
Copy Markdown
Owner

@flying-sheep could you also fix the failing tests please?

@flying-sheep
Copy link
Copy Markdown
Contributor Author

OK, done!

@madyankin madyankin merged commit f15ec33 into madyankin:master Apr 30, 2017
@madyankin
Copy link
Copy Markdown
Owner

@flying-sheep published

@flying-sheep flying-sheep deleted the getJSON-promise branch April 30, 2017 19:58
@flying-sheep
Copy link
Copy Markdown
Contributor Author

thank you!

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