-
Unbroken Ltd
- Cheltenham
- http://unbroken.digital
Pinned Loading
-
Angular2 + TypeScript file size Pipe...
Angular2 + TypeScript file size Pipe/Filter. Convert bytes into largest possible unit. e.g. 1024 => 1 KB 1/**
2* @license
3* Copyright (c) 2019 Jonathan Catmull.
4*
5* Permission is hereby granted, free of charge, to any person obtaining a copy
-
Relative date Pipe for Angular2 + Ty...
Relative date Pipe for Angular2 + TypeScript . Convert date|timestamp into relative date string e.g. "5 days ago", "1 minute ago" etc. 1import { Pipe, PipeTransform } from '@angular/core';
23// Epochs
4const epochs: any = [
5['year', 31536000],
-
Appends ordinal (st, nd ,rd ,th) to ...
Appends ordinal (st, nd ,rd ,th) to number or turns number into ordinal. Typescript Angular2 Pipe 1import { Pipe, PipeTransform } from '@angular/core';
23const ordinals: string[] = ['th','st','nd','rd'];
45/*
-
RXJS operator function to store a st...
RXJS operator function to store a stream in localStorage, then replays from localStorage when provided BehaviourSubject is true. This is helpful if you need to replay a complicated set of observable streams after a browser redirect. 12/**
3* Stores last emitted value in localStorage and replays if usStore$ is set.
4* If usStore$ is truthy then switches stream to use stored value.
5* If usStore$ is undefined then stream will emit as normal.
-
RxJs operator to reload a JWT when i...
RxJs operator to reload a JWT when it expires 1import { MonoTypeOperatorFunction, BehaviorSubject, Observable } from 'rxjs';
2import { switchMapTo, tap, shareReplay } from 'rxjs/operators';
3import JwtDecode from 'jwt-decode';
45/**
-
RxJS custom operator to debounce a s...
RxJS custom operator to debounce a stream for set time after first value is emitted. 12/**
3* Debounce after first emit.
4* This operator will debounce all requests apart from the first for a set duration.
5* @param ms time to wait in milliconds.
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.