diff options
author | crupest <crupest@outlook.com> | 2020-07-30 23:12:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-30 23:12:55 +0800 |
commit | 2afc8d5d6b1e7cb466e62d0e59e2c05143d664c6 (patch) | |
tree | 43a9e1dc4de281e3d4295e6aaac7253827008d00 /Timeline/ClientApp/src/app/data/SubscriptionHub.ts | |
parent | d3085ff3483c063b07b9553b539f3836b666cac8 (diff) | |
download | timeline-2afc8d5d6b1e7cb466e62d0e59e2c05143d664c6.tar.gz timeline-2afc8d5d6b1e7cb466e62d0e59e2c05143d664c6.tar.bz2 timeline-2afc8d5d6b1e7cb466e62d0e59e2c05143d664c6.zip |
Save post list locally.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/SubscriptionHub.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/data/SubscriptionHub.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Timeline/ClientApp/src/app/data/SubscriptionHub.ts b/Timeline/ClientApp/src/app/data/SubscriptionHub.ts index f09cd9f8..406d293f 100644 --- a/Timeline/ClientApp/src/app/data/SubscriptionHub.ts +++ b/Timeline/ClientApp/src/app/data/SubscriptionHub.ts @@ -124,11 +124,11 @@ export class SubscriptionHub<TKey, TData> // Old data is destroyed automatically.
// updator is called only if there is subscription.
- update(key: TKey, updator: (key: TKey) => Promise<TData>): void {
+ update(key: TKey, updator: (key: TKey, old: TData) => Promise<TData>): void {
const keyString = this.keyToString(key);
const line = this.subscriptionLineMap.get(keyString);
if (line != null) {
- line.next(() => updator(key));
+ line.next((old) => updator(key, old));
}
}
}
|