-
Notifications
You must be signed in to change notification settings - Fork 63
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
Cordova supported platforms lack suport for ES6 Promise #5
Comments
The es6-promise-plugin is installed. For others that run into this problem, I get it to work with statements of the form: |
Hi Howard, Yes you're quite right. It's not the Promise in the older webviews that might be the problem, but it is the arrow functions that is shown in my examples. The two snippets below are functionally identical. Works in modern devices, or JavaScript projects using a transpiler:
Used in older devices, or non-transpiled projects:
|
Thanks! From: Sam Kelleher [mailto:notifications@github.com] Hi Howard, Yes you're quite right. It's not the Promise in the older webviews that might be the problem, but it is the arrow functions https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions that is shown in my examples. The two snippets below are functionally identical. Works in modern devices, or JavaScript projects using a transpiler: .then((payment) => { }); Used in older devices, or non-transpiled projects: .then(function(payment) { }); — |
I have not used promises before. I am getting snytactic errors in my cordova app. Research indicates that Cordova supported platforms lack suport for ES6 Promise. There is a plugin, PromisesPlugin, that says they rectifies this problem. Do you recommend this plugin for Cordova apps are should I do something else??
The particular syntax problem is of the form .then((message) => { . Your example will not build.
Thanks!
Howard
The text was updated successfully, but these errors were encountered: