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

Clarify API usage #1811

Merged
merged 4 commits into from
Jul 26, 2019
Merged

Clarify API usage #1811

merged 4 commits into from
Jul 26, 2019

Conversation

dotNetkow
Copy link
Contributor

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.

1) Import the API:
```typescript
import { Browser } from '@capacitor/core';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { Browser } from '@capacitor/core';
import { Plugins } from '@capacitor/core';

Copy link
Member

@jcesarmobile jcesarmobile left a 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".

Copy link
Member

@jcesarmobile jcesarmobile left a 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

site/docs-md/apis/index.md Outdated Show resolved Hide resolved
site/docs-md/apis/index.md Outdated Show resolved Hide resolved
dotNetkow and others added 2 commits July 26, 2019 11:30
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dotNetkow dotNetkow merged commit dcd0a2f into master Jul 26, 2019
@jcesarmobile jcesarmobile deleted the clarify-api-usage branch July 26, 2019 17:43
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

Successfully merging this pull request may close these issues.

2 participants