aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/data/timeline.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-07-27 17:43:46 +0800
committercrupest <crupest@outlook.com>2020-07-27 17:43:46 +0800
commitc10218d8d5ec01ae29c0b2880a8d6af371a562e5 (patch)
treec86309b2c68ba3e9ffc1973e406f02b7fd4609cf /Timeline/ClientApp/src/app/data/timeline.ts
parente26b101fdec6cacb54d09e66c0ef06cfad5e490c (diff)
downloadtimeline-c10218d8d5ec01ae29c0b2880a8d6af371a562e5.tar.gz
timeline-c10218d8d5ec01ae29c0b2880a8d6af371a562e5.tar.bz2
timeline-c10218d8d5ec01ae29c0b2880a8d6af371a562e5.zip
Add post list subscription hub.
Diffstat (limited to 'Timeline/ClientApp/src/app/data/timeline.ts')
-rw-r--r--Timeline/ClientApp/src/app/data/timeline.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/data/timeline.ts b/Timeline/ClientApp/src/app/data/timeline.ts
index dde204be..f2c3fdda 100644
--- a/Timeline/ClientApp/src/app/data/timeline.ts
+++ b/Timeline/ClientApp/src/app/data/timeline.ts
@@ -126,6 +126,28 @@ export class TimelineService {
);
}
+ private _postListSubscriptionHub = new SubscriptionHub<
+ string,
+ TimelinePostInfo[]
+ >(
+ (key) => key,
+ async (key) => {
+ return (
+ await getHttpTimelineClient().listPost(
+ key,
+ userService.currentUser?.token
+ )
+ ).map((post) => ({
+ ...post,
+ timelineName: key,
+ }));
+ }
+ );
+
+ get postListSubscriptionHub(): ISubscriptionHub<string, TimelinePostInfo[]> {
+ return this._postListSubscriptionHub;
+ }
+
private _postDataSubscriptionHub = new SubscriptionHub<PostKey, BlobWithUrl>(
(key) => `${key.timelineName}/${key.postId}`,
async (key) => {