Subscriptions return unsubscribe/dispose function (#527)
* Combinator return unsubscribe/dispose function * Submittable extrinsics return UnsubFunction * RPC methods with unsub callback returns * Update changelog, bump version * CHANGELOG typo * Fix combinator unsubscribes * Be explicit in returns for UnsubFunction (combineLatest)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@polkadot/types",
|
||||
"version": "0.35.19",
|
||||
"version": "0.36.0",
|
||||
"description": "Implementation of the Parity codec",
|
||||
"main": "index.js",
|
||||
"keywords": [
|
||||
@@ -30,8 +30,8 @@
|
||||
"homepage": "https://github.com/polkadot-js/api/tree/master/packages/types#readme",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.2.0",
|
||||
"@polkadot/keyring": "^0.33.27",
|
||||
"@polkadot/util": "^0.33.27",
|
||||
"@polkadot/keyring": "^0.33.28",
|
||||
"@polkadot/util": "^0.33.28",
|
||||
"core-js": "^2.6.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,13 +63,12 @@ function addRpc () {
|
||||
}).join(', ');
|
||||
const type = '`' + method.type + '`';
|
||||
const isSub = method.isSubscription;
|
||||
const renderMethod = `${md}\n▸ **${methodName}**(${args})`;
|
||||
const renderMethod = `${md}\n▸ **${methodName}**(${args}`;
|
||||
const renderReturnType = `: ${type}`;
|
||||
const renderSignature = `${renderMethod}${renderReturnType}`;
|
||||
const renderSignatureSub = `${renderMethod}**.subscribe**(CALLBACK)${renderReturnType}`;
|
||||
const renderSummary = `${method && method.description ? `\n- **summary**: ${method.description}\n` : `\n\n`}`;
|
||||
|
||||
return isSub ? `${renderSignatureSub}${renderSummary}` : `${renderSignature}${renderSummary}`;
|
||||
return `${renderSignature}${isSub ? ', CALLBACK' : ''})${renderSummary}`;
|
||||
}, renderSection);
|
||||
}, renderHeading + renderAnchors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user