-
Notifications
You must be signed in to change notification settings - Fork 55
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
Better support for promises #196
Comments
We have a "promiser" helper function that allows you to turn any our callback based APIs into promise based APIs with a single line of code. For an example of the promiser in action see: https://github.com/forcedotcom/SalesforceMobileSDK-Templates/blob/dev/MobileSyncExplorerReactNative/js/StoreMgr.js#L30 |
@wmathurin As mentioned above, here are the limitations with
|
Valid points @jpmonette. Re-opening issue. |
It would be great to support promises without having to rely on the promiser, in order to:
sendRequest
, wheresuccessCB
anderrorCB
are not the last arguments)syncName
insyncUp
).This would require to add a type check in each function to see if the callbacks have been provided. If not, the function could return a Promise.
Here's a sample implementation for the
query
function:And of course, we would benefit from the IntelliSense for both versions of the function.
The text was updated successfully, but these errors were encountered: