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

feat(rollbar): Add Rollbar plugin #832

Merged
merged 4 commits into from
Jan 20, 2017
Merged

feat(rollbar): Add Rollbar plugin #832

merged 4 commits into from
Jan 20, 2017

Conversation

akz92
Copy link
Contributor

@akz92 akz92 commented Nov 28, 2016

No description provided.

@ihadeed ihadeed added this to the v2.3.0 milestone Nov 29, 2016
* @return {Promise<any>} Returns a promise that resolves when the plugin successfully initializes
*/
@Cordova()
static init(successCallback?: Function, errorCallback?: Function) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add a return type : Promise<any> to this function. Also keep { return; } all in the same line.

Thanks.

Copy link
Contributor Author

@akz92 akz92 Nov 29, 2016

Choose a reason for hiding this comment

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

@ihadeed sure. I documented this function as returning Promise<any> because, as far as I know, ionic-native wraps every function in a promise. The plugin function itself doesn't return anything. Is this the right approach or should I document it as returning void?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Here is an example of how it should look like: https://github.com/driftyco/ionic-native/blob/master/src/plugins/camera.ts#L201

The docs are fine, just need to add a TypeScript return type of Promise<any>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, did it.

* @return {Promise<any>} Returns a promise that resolves when the plugin successfully initializes
*/
@Cordova()
static init(successCallback?: Function, errorCallback?: Function): Promise<any> { return; }
Copy link
Collaborator

@ihadeed ihadeed Nov 29, 2016

Choose a reason for hiding this comment

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

You also need to remove successCallback?: Function, errorCallback?: Function. The @Cordova() decorator will automatically apply resolve and reject of the promise to these arguments.

Sorry I didn't mention this earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, removed it.

@ihadeed ihadeed modified the milestones: v2.4.0, v2.3.0 Nov 29, 2016
@ihadeed ihadeed merged commit 229f550 into danielsogl:master Jan 20, 2017
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.

None yet

2 participants