Commit 2b357a0abf8cd06b2aed2d9ce2eb76069888fd71
readyCb no longer needed
Dominic Tarr committed on 3/6/2015, 7:30:13 PMParent: 93989fb4f2182e5c9a2df88cc6f8dc7efb421a06
Files changed
index.js | changed |
index.js | |||
---|---|---|---|
@@ -10,9 +10,13 @@ | |||
10 | 10 … | function isFunction (f) { | |
11 | 11 … | return 'function' === typeof f | |
12 | 12 … | } | |
13 | 13 … | ||
14 | -module.exports = function (keys, config, readyCb) { | ||
14 … | +function throwIfError(err) { | ||
15 … | + if(err) throw err | ||
16 … | +} | ||
17 … | + | ||
18 … | +module.exports = function (keys, config) { | ||
15 | 19 … | var manifest | |
16 | 20 … | //if we are in the browser | |
17 | 21 … | config.host = config.host || 'localhost' | |
18 | 22 … | var client = muxrpc(loadManf(config), false, serialize)() | |
@@ -67,11 +71,9 @@ | |||
67 | 71 … | } | |
68 | 72 … | ||
69 | 73 … | client.close = function(cb) { | |
70 | 74 … | wsStream.close() | |
71 | - rpcStream.close(function () { | ||
72 | - cb && cb() | ||
73 | - }) | ||
75 … | + rpcStream.close(cb ? cb : throwIfError) | ||
74 | 76 … | return client | |
75 | 77 … | } | |
76 | 78 … | ||
77 | 79 … | client.reconnect = function(opts) { |
Built with git-ssb-web