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 | b28c6401b83dd06411c34d2148ff6a4e4a9ade7c (patch) | |
tree | 8c5367d16e554f9c969627210b322245ecb6b800 /Timeline/ClientApp/src/app/data/SubscriptionHub.ts | |
parent | ec6b783611ea50d11699dd6a9bbf944488ff9797 (diff) | |
download | timeline-b28c6401b83dd06411c34d2148ff6a4e4a9ade7c.tar.gz timeline-b28c6401b83dd06411c34d2148ff6a4e4a9ade7c.tar.bz2 timeline-b28c6401b83dd06411c34d2148ff6a4e4a9ade7c.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));
}
}
}
|