Skip to content
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

Support for Observables #63

Open
myin142 opened this issue Sep 26, 2019 · 2 comments
Open

Support for Observables #63

myin142 opened this issue Sep 26, 2019 · 2 comments

Comments

@myin142
Copy link

myin142 commented Sep 26, 2019

I want to create a ionic-native plugin for this cordova plugin. But the support for observable/promise does not seem to be considered. For example returning 2 values on start is not supported by observables/promises. And using callbacks does not seem normal for ionic/angular.

So I would like to change the code to better support observables and move the callback functions to actual functions. But that would be a huge change of the code. I do not know if it would be acceptable for such a change. If not, I would just use my fork for my project.

@becvert
Copy link
Owner

becvert commented Sep 26, 2019

Feel free to make a Pull Request then we'll see.

You can return multiple values in Promise, for instance:
Promise.resolve([1,2]).then(([arg1,arg2]) => console.log('result', arg1, arg2))
Does this help?

@myin142
Copy link
Author

myin142 commented Sep 26, 2019

Yes it did seem to return 2 values, but I will still try to change it. Observables are better IMO for Ionic/Angular. The only problem is, I have no idea how to program or test iOS. I neither have an iPhone to test it with nor an Mac to build it. We'll see how it works

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

No branches or pull requests

2 participants