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:
Jaco Greeff
2019-01-03 16:31:09 +01:00
committed by GitHub
parent 15d75f7166
commit 3be56ad56c
19 changed files with 173 additions and 137 deletions
+3 -3
View File
@@ -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"
}
}
+2 -3
View File
@@ -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);
}