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

Discuss: A good way to implement instance based plugins #86

Closed
ihadeed opened this issue Mar 26, 2016 · 0 comments · Fixed by #97
Closed

Discuss: A good way to implement instance based plugins #86

ihadeed opened this issue Mar 26, 2016 · 0 comments · Fixed by #97

Comments

@ihadeed
Copy link
Collaborator

ihadeed commented Mar 26, 2016

Many good plugins out there that we want to implement are instance based.

For example, look at the usage of the SQLite plugin:

// first we create a database object
var db = window.sqlitePlugin.openDatabase(....);

// then we call it's methods
db.executeSql(...);

Now if we were to wrap this plugin and add it to Ionic Native, we wouldn't really be improving anything since we can't wrap the internal (prototype) methods. Not being able to wrap these internal methods means that we still have to use callback functions. Therefore, the Angular 2 change detection will not be triggered.

So the purpose of this discussion to gather ideas on how we can approach these type of plugins in a better way.

All thoughts and suggestions are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant