-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Clarify API usage #1811
Clarify API usage #1811
Conversation
site/docs-md/apis/index.md
Outdated
1) Import the API: | ||
```typescript | ||
import { Browser } from '@capacitor/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Browser } from '@capacitor/core'; | |
import { Plugins } from '@capacitor/core'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment, but after reading the changes, I don't think they make the usage it clearer, the wording seems even more confusing.
Instead of "Import the API" could be "Import the Plugins
object, it represents the Registry of all Capacitor plugins" or something like that.
Instead of "Extract the API object from Plugins
:" could be, "Get the Plugin from the Plugin Registry (Plugins
) object".
Instead of " Use the API:", " Use the Plugin API:"
I don't understand the "By instead leveraging the API object".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added two more changes
Co-Authored-By: jcesarmobile <[email protected]>
Co-Authored-By: jcesarmobile <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Multiple users (myself including) have been confused by how to leverage Capacitor APIs properly. it's really easy to forget to use the API object itself - here's an attempt to clarify things.