diff options
author | crupest <crupest@outlook.com> | 2020-07-27 17:43:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-07-27 17:43:46 +0800 |
commit | 328036901d825179b6e916ee9d79e9396cf982d4 (patch) | |
tree | 428f30e0f291ac31fbd6dea17164cef60d8683e8 /Timeline/ClientApp/src/app/data/timeline.ts | |
parent | d900c1b8c012970db491f421e1975f5de3b450f3 (diff) | |
download | timeline-328036901d825179b6e916ee9d79e9396cf982d4.tar.gz timeline-328036901d825179b6e916ee9d79e9396cf982d4.tar.bz2 timeline-328036901d825179b6e916ee9d79e9396cf982d4.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.ts | 22 |
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) => {
|