Closed ggrossetie closed 9 years ago
Not an edge case, but in the meantime, since they return a node-style callback, you can use a library like Q to wrap those function calls to act like promises.
Yes, I agree it is better with Promises, but since there is no standard Promise implementation available everywhere yet, it would mean introduce an extra dependencies.
As @masterots says, in the meantime it is possible to wrap callback using Q.
Yes that's true, that would introduce an extra dependencies... do you know if a standard Promise implementation will come anytime soon ?
Thanks for you help, I ended up using https://github.com/kriszyp/node-promise but didn't work out so well. I will give Q a try.
Any chance (or tutorial) to integrate Prismic with KoaJS (or generators, using --harmony)?
Hi azappa,
We only provide starter kit for the most popular frameworks, which is why for Node.js we have an Express.js starter: https://github.com/prismicio/javascript-nodejs-starter
That said the kit should work with any framework, if you have any problem to integrate it with KoaJS don't hesitate to reach us either though a support ticket or here.
I think it would be great if the
submit()
method returns a Promise. In my case I need to query multiple documents to compose my page (the two latest news, the page content, a popular member, etc...) and my code is a callback hell !But will look much better with Promise:
Maybe I'm missing something with the API ? Or my use case is an edge case ?
Thanks, and great product by the way (a pleasure to develop a website with :+1:)