Skip to content

Commit

Permalink
Adding JSDocs for the connect method 😊
Browse files Browse the repository at this point in the history
  • Loading branch information
yanshcherbakovatredspace committed Jan 8, 2018
1 parent bb855e2 commit b23b68b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/rebound/rebound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ export class Rebound {
}
}

//This is because a constructor should only be setting crucial variables.
/**
* This method creates a connection with the host and starts the message listener
* this method should be overridden in case the connect message that is recieved
* back is in a different format other than an object. In cases where HammerSpace
* is used with a host that is not HammerSpace.
* @protected
* @method connect
*/
protected _connect() {
if (this._isChild) {
this.dispatch({event: 'connected', id: this._randId});
Expand Down Expand Up @@ -167,5 +174,10 @@ export class Rebound {
*/
public dispatch: (name: ReboundEvent) => void = this._dispatch;

/**
* Calls the private method _connect
* @public
* @method connect
*/
public connect: () => void = this._connect;
}

0 comments on commit b23b68b

Please sign in to comment.