Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jacogr committed Oct 11, 2018
1 parent eba79f1 commit 742aa13
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
11 changes: 8 additions & 3 deletions packages/api/src/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export default abstract class ApiBase<R, S, E> implements ApiBaseInterface<R, S,
protected _runtimeVersion?: RuntimeVersion;

/**
* @description Create an instance of the class
*
* @param wsProvider A WebSocket provider from rpc-provider/ws. If not specified, it will default to connecting to the localhost with the default port
*
* @example
Expand Down Expand Up @@ -155,10 +157,13 @@ export default abstract class ApiBase<R, S, E> implements ApiBaseInterface<R, S,
}

/**
* @description
* @param type The type of event to listen to. Availble events are `connected`, `disconnected` and `ready`
* @description Attach an eventemitter handler to listen to a specific event
*
* @param type The type of event to listen to. Available events are `connected`, `disconnected` and `ready`
* @param handler The callback to be called when the event fires. Depending on the event type, it could fire with additional arguments.
* @example<BR>
*
* @example
* <BR>
*
* ```javascript
* * api.on('disconnected', () => {
Expand Down
7 changes: 7 additions & 0 deletions packages/api/src/promise/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ import { StorageFunction } from '@polkadot/types/StorageKey';
* ## Overview
*
* @name ApiPromise
*
* @description
* ApiPromise is a standard JavaScript wrapper around the RPC and interfaces on the Polkadot network. As a full Promise-based, all interface calls return Promises, including the static `.create(...)`. Subscription calls utilise standard JavaScript-convention `(error, value)` callbacks.
*
* The API is well suited to real-time applications where either the single-shot state is needed or use is to be made of the subscription-based features of Polkadot (and Substrate) clients.
*
* @see [[ApiRx]]
*
* ## Usage
Expand Down Expand Up @@ -102,7 +104,9 @@ export default class ApiPromise extends ApiBase<Rpc, QueryableStorage, Submittab

/**
* @description Creates an ApiPromise instance using the supplied provider. Returns an Promise containing the actual Api instance.
*
* @param wsProvider WebSocket provider that is passed to the class contructor
*
* @example
* <BR>
*
Expand All @@ -121,7 +125,10 @@ export default class ApiPromise extends ApiBase<Rpc, QueryableStorage, Submittab
}

/**
* @description Creates an instance of the ApiPromise class
*
* @param wsProvider WebSocket provider from rpc-provider/ws. If not specified, it will default to connecting to the localhost with the default port, i.e. `ws://127.0.0.1:9944`
*
* @example
* <BR>
*
Expand Down
7 changes: 7 additions & 0 deletions packages/api/src/rx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ const l = logger('api-rx');
* ## Overview
*
* @name ApiRx
*
* @description
* ApiRx is a powerfull RxJS Observable wrapper around the RPC and interfaces on the Polkadot network. As a full Observable API, all interface calls return RxJS Observables, including the static `.create(...)`. In the same fashion and subscription-based methods return long-running Observables that update with the latest values.
*
* The API is well suited to real-time applications where the latest state is needed, unlocking the subscription-based features of Polkadot (and Substrate) clients. Some familiarity with RxJS is a requirement to use the API, however just understanding `.subscribe` and `.pipe` on Observables will unlock full-scale use thereof.
*
* @see [[ApiPromise]]
*
* ## Usage
Expand Down Expand Up @@ -120,7 +122,9 @@ export default class ApiRx extends ApiBase<RpcRx, QueryableStorage, SubmittableE

/**
* @description Creates an ApiRx instance using the supplied provider. Returns an Observable containing the actual Api instance.
*
* @param wsProvider WebSocket provider that is passed to the class contructor
*
* @example
* <BR>
*
Expand All @@ -139,7 +143,10 @@ export default class ApiRx extends ApiBase<RpcRx, QueryableStorage, SubmittableE
}

/**
* @description Create an instance of the ApiRx class
*
* @param wsProvider A WebSocket provider from rpc-provider/ws. If not specified, it will default to connecting to the localhost with the default port, i.e. `ws://127.0.0.1:9944`
*
* @example
* <BR>
*
Expand Down
5 changes: 2 additions & 3 deletions packages/rpc-provider/src/http/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ const ERROR_SUBSCRIBE = 'HTTP Provider does not have subscriptions, use WebSocke
* # @polkadot/rpc-provider/https
*
* @name HttpProvider
* @summary The HTTP Provider allows sending requests using HTTP to a HTTP RPC server TCP port.
* @description It does not support subscriptions so you won't be able to listen to events
* such as new blocks or balance changes. It is usually preferrable using the [[WsProvider]].
*
* @description The HTTP Provider allows sending requests using HTTP to a HTTP RPC server TCP port. It does not support subscriptions so you won't be able to listen to events such as new blocks or balance changes. It is usually preferrable using the [[WsProvider]].
*
* @example
* <BR>
Expand Down
6 changes: 3 additions & 3 deletions packages/rpc-provider/src/ws/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ interface WSProviderInterface extends ProviderInterface {
* # @polkadot/rpc-provider/ws
*
* @name WsProvider
* @summary The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port.
* @description Unlike the [[HttpProvider]], it does support subscriptions and allows
* listening to events such as new blocks or balance changes.
*
* @description The WebSocket Provider allows sending requests using WebSocket to a WebSocket RPC server TCP port. Unlike the [[HttpProvider]], it does support subscriptions and allows listening to events such as new blocks or balance changes.
*
* @example
* <BR>
*
Expand Down

0 comments on commit 742aa13

Please sign in to comment.