diff --git a/README.md b/README.md index 4f018c6..b606328 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ details. #### Methods -`constructor({ schema, transport, getSubjects, options: { batchSize, highWaterMark, noAckStreams, timeout }}` +`constructor({ schema, transport, getSubjects, options: { batchSize, highWaterMark, noAckStream, timeout }}` * `schema` @@ -114,7 +114,7 @@ details. When set, the stream will push messages in chunks of that size. - * `noAckStreams` + * `noAckStream` When `true`, allows piping to provider without acknowledgement, i.e. fire and forget. diff --git a/package.json b/package.json index 95bb730..87cbb5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pubsub-store", - "version": "0.8.1", + "version": "0.8.2", "description": "Pub/Sub Store", "main": "src/index.js", "scripts": { diff --git a/src/provider.js b/src/provider.js index 4e78508..d43010a 100644 --- a/src/provider.js +++ b/src/provider.js @@ -76,14 +76,12 @@ const exec = curry((request, { noAckStream, timeout }, query) => new Promise( // reject query on timeout // NB: timeout is set in Promise context only when noAckStream // is false and is cancelled in request callback - tap(partial(clearTimeout, [ !noAckStream - ? setTimeout( - partial(reject, [ - new ProviderError(`query timeout after ${timeout}ms`, query) - ]), - timeout - ) - : null + tap(partial(clearTimeout, [ setTimeout( + partial(reject, [ + new ProviderError(`query timeout after ${timeout}ms`, query) + ]), + timeout + ) ])), JSON.parse,