Skip to content

Instantly share code, notes, and snippets.

@code-vagabond
Created September 16, 2018 23:11
Show Gist options
  • Save code-vagabond/abe168170168f0a33a91223860ba9253 to your computer and use it in GitHub Desktop.
Save code-vagabond/abe168170168f0a33a91223860ba9253 to your computer and use it in GitHub Desktop.
Reverse an observable
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'reverse'
})
export class ReversePipe implements PipeTransform {
transform(value) {
if (!value) { return; }
return value.reverse();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment