aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/data/SubscriptionHub.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-07-30 23:12:55 +0800
committercrupest <crupest@outlook.com>2020-07-30 23:12:55 +0800
commit2afc8d5d6b1e7cb466e62d0e59e2c05143d664c6 (patch)
tree43a9e1dc4de281e3d4295e6aaac7253827008d00 /Timeline/ClientApp/src/app/data/SubscriptionHub.ts
parentd3085ff3483c063b07b9553b539f3836b666cac8 (diff)
downloadtimeline-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.ts4
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));
}
}
}