Skip to content

(feature) live timestamps

Brian Hatchet requested to merge live-timestamps into goal.CommentThreads

Added a timediff services that provides an observable singleton so we can update things on the same clock tick using rxjs' observable interval

Rather than manually wire up subscribe and unsubscribe, used the fancy async pipe which unpacks all that for us. Necessitates some *ngIf magic to handle the initial null case which works great because it stops rending 0 seconds.

In the comment comment, map the timediff clock tick to the age of the rendered comment and the friendly date diff takes cares of the rest.

Merge request reports