Skip to content

Instantly share code, notes, and snippets.


David Henley davidhenley

  • Best Brands Inc.
  • Nashville, TN
View GitHub Profile
davidhenley / state.ts
Last active Jul 20, 2020
State with RxJS
View state.ts
import { Observable, BehaviorSubject } from 'rxjs';
import { distinctUntilChanged, pluck } from 'rxjs/operators';
export interface Todo {
text: string;
complete: boolean;
export interface State {
todos: Todo[];
View angular-hooks.ts
import { Component } from '@angular/core';
selector: 'hooks-example',
template: `
<p>You clicked {{count}} times</p>
<button (click)="setCount(count + 1)">Click Me</button>
export class HooksComponent {
You can’t perform that action at this time.