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 | c10218d8d5ec01ae29c0b2880a8d6af371a562e5 (patch) | |
| tree | c86309b2c68ba3e9ffc1973e406f02b7fd4609cf /Timeline/ClientApp/src/app/data/timeline.ts | |
| parent | e26b101fdec6cacb54d09e66c0ef06cfad5e490c (diff) | |
| download | timeline-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.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) => {
|
