However, promises (used in the javascript sdk) are generally awesome, and coincidentally all but eliminate the need for "waterfall" once you convert callback-based code to being promise-based. If you have access to a working version of the BL CLI (http://devcenter.kinvey.com/nodejs/tutorials/business-logic-revisions), I'd **highly** recommend investing time in add a good promises library to "common code", and converting as much of your BL to be promise-based as humanly possible (we plan to do this as soon as a CLI issue on Ubuntu is ironed out)
M
Michael Marsh
said
about 7 years ago
sorry about the formatting, here's a gist: https://gist.github.com/micmarsh/f9cecb02af47d3bdfe3c
M
Michael LeBarron
said
about 7 years ago
oh wow I totally missed the "common code" section of that doc.
I actually kept getting frustrated not being able to use promises... yeah, guess I should add one there.
Thanks!
M
Michael Marsh
said
about 7 years ago
No problem, glad to be of help! :-)
M
Michael LeBarron
said
about 7 years ago
have you had any luck loading a library into utils?
I can't even get the example they have to work.
M
Michael Marsh
said
about 7 years ago
I'm still waiting for a working Ubuntu version of the CLI, but I'll let you know if and when I am able to try something!
M
Michael LeBarron
said
about 7 years ago
I tried it today with Q but setTimeout isn't supported so the whole thing just ends up failing.
Not really sure where to go with this when any setTimeout usage kills it.
M
Michael Marsh
said
about 7 years ago
Ah, I haven't been able to try anything yet since I'm still waiting on a fix for the Ubuntu CLI. At this point, I would just start searching github for promise libraries and making sure they don't have setTimeout anywhere :-/
Michael LeBarron