presidium 0.29.1 → 0.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/DynamoStream.js +6 -9
  2. package/package.json +1 -1
package/DynamoStream.js CHANGED
@@ -183,14 +183,13 @@ DynamoStream.prototype.getRecords = async function* getRecords(
183
183
  const SymbolUpdateShards = Symbol('UpdateShards')
184
184
 
185
185
  DynamoStream.prototype[Symbol.asyncIterator] = async function* () {
186
- let shards = await pipe([
187
- always(this.getStreams()),
186
+ let shards = await pipe(this.getStreams(), [
188
187
  flatMap(Stream => this.getShards(Stream)),
189
188
  map(assign({
190
189
  ShardIteratorType: always(this.shardIteratorType),
191
190
  })),
192
191
  transform(Transducer.passthrough, []),
193
- ])()
192
+ ])
194
193
  let muxAsyncIterator = Mux.race([
195
194
  ...shards.map(Shard => this.getRecords(Shard)),
196
195
  (async function* UpdateShardsGenerator() {
@@ -206,13 +205,11 @@ DynamoStream.prototype[Symbol.asyncIterator] = async function* () {
206
205
  while (!this.closed) {
207
206
  const { value, done } = await muxAsyncIterator.next()
208
207
  if (value == SymbolUpdateShards) {
209
- const latestShards = await pipe([
210
- always(this.getStreams()),
208
+ const latestShards = await pipe(this.getStreams(), [
211
209
  flatMap(Stream => this.getShards(Stream)),
212
210
  transform(Transducer.passthrough, []),
213
- ])()
214
- const newShards = pipe([
215
- always(shards),
211
+ ])
212
+ const newShards = pipe(shards, [
216
213
  differenceWith(
217
214
  (ShardA, ShardB) => ShardA.ShardId == ShardB.ShardId,
218
215
  latestShards,
@@ -220,7 +217,7 @@ DynamoStream.prototype[Symbol.asyncIterator] = async function* () {
220
217
  map(assign({
221
218
  ShardIteratorType: always('TRIM_HORIZON'),
222
219
  })),
223
- ])()
220
+ ])
224
221
 
225
222
  shards = latestShards
226
223
  if (newShards.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "presidium",
3
- "version": "0.29.1",
3
+ "version": "0.29.2",
4
4
  "description": "A library for creating web services",
5
5
  "author": "Richard Tong",
6
6
  "license": "MIT",