@dra2020/baseclient 1.0.6 → 1.0.9
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.
- package/dist/baseclient.js +18 -8
- package/dist/baseclient.js.map +1 -1
- package/dist/fsm/fsm.d.ts +1 -0
- package/dist/ot-js/otsession.d.ts +2 -0
- package/lib/fsm/fsm.ts +12 -2
- package/lib/geo/geo.ts +7 -5
- package/lib/ot-js/otsession.ts +2 -0
- package/package.json +1 -1
package/dist/fsm/fsm.d.ts
CHANGED
package/lib/fsm/fsm.ts
CHANGED
|
@@ -291,6 +291,7 @@ export class FsmOnDone extends Fsm
|
|
|
291
291
|
export class FsmSleep extends Fsm
|
|
292
292
|
{
|
|
293
293
|
delay: number;
|
|
294
|
+
timeoutHandle: any;
|
|
294
295
|
|
|
295
296
|
constructor(env: FsmEnvironment, delay: number)
|
|
296
297
|
{
|
|
@@ -300,10 +301,19 @@ export class FsmSleep extends Fsm
|
|
|
300
301
|
|
|
301
302
|
tick(): void
|
|
302
303
|
{
|
|
303
|
-
|
|
304
|
+
// This allows canceling by simply setting state to done
|
|
305
|
+
if (this.done && this.timeoutHandle !== undefined)
|
|
306
|
+
{
|
|
307
|
+
clearTimeout(this.timeoutHandle);
|
|
308
|
+
delete this.timeoutHandle;
|
|
309
|
+
}
|
|
310
|
+
else if (this.ready && this.state === FSM_STARTING)
|
|
304
311
|
{
|
|
305
312
|
this.setState(FSM_PENDING);
|
|
306
|
-
setTimeout(() => {
|
|
313
|
+
this.timeoutHandle = setTimeout(() => {
|
|
314
|
+
delete this.timeoutHandle;
|
|
315
|
+
this.setState(FSM_DONE)
|
|
316
|
+
}, this.delay);
|
|
307
317
|
}
|
|
308
318
|
}
|
|
309
319
|
}
|
package/lib/geo/geo.ts
CHANGED
|
@@ -218,10 +218,8 @@ export class GeoMultiCollection
|
|
|
218
218
|
if (n == 1)
|
|
219
219
|
this.all.col = this._col(this.nthEntry(0));
|
|
220
220
|
else
|
|
221
|
-
|
|
222
|
-
this.all.col =
|
|
223
|
-
this.forEach(f => { this.all.col.features.push(f) });
|
|
224
|
-
}
|
|
221
|
+
// Going from map to collection guarantees that any duplicates are removed
|
|
222
|
+
this.all.col = geoMapToCollection(this.allMap());
|
|
225
223
|
}
|
|
226
224
|
return this.all.col;
|
|
227
225
|
}
|
|
@@ -236,7 +234,11 @@ export class GeoMultiCollection
|
|
|
236
234
|
if (n == 1)
|
|
237
235
|
this.all.map = this._map(this.nthEntry(0));
|
|
238
236
|
else
|
|
239
|
-
|
|
237
|
+
{
|
|
238
|
+
let map: GeoFeatureMap = {};
|
|
239
|
+
this.all.map = map;
|
|
240
|
+
this.forEach(f => { map[String(f.properties.id)] = f });
|
|
241
|
+
}
|
|
240
242
|
}
|
|
241
243
|
return this.all.map;
|
|
242
244
|
}
|
package/lib/ot-js/otsession.ts
CHANGED