Skip to content

Instantly share code, notes, and snippets.

View davidhenley's full-sized avatar

David Henley davidhenley

  • Best Brands Inc.
  • Nashville, TN
View GitHub Profile
@davidhenley
davidhenley / state.ts
Last active July 20, 2020 14:29
State with RxJS
import { Observable, BehaviorSubject } from 'rxjs';
import { distinctUntilChanged, pluck } from 'rxjs/operators';
export interface Todo {
text: string;
complete: boolean;
}
export interface State {
todos: Todo[];
@davidhenley
davidhenley / angular-hooks.ts
Last active September 10, 2019 21:37
Angular Hooks
import { Component } from '@angular/core';
@Component({
selector: 'hooks-example',
template: `
<p>You clicked {{count}} times</p>
<button (click)="setCount(count + 1)">Click Me</button>
`
})
export class HooksComponent {