UNPKG

redux-app-examples

Version:

Examples of redux-app with Angular and React.

22 lines (18 loc) 465 B
import { action } from "redux-app"; /** * Encapsulates storage and modification of a single value. */ export class Value<T> { public value: T; constructor(initial?: T) { this.value = initial; } @action public setValue(newValue: T): void { this.value = newValue; } @action public updateValue(newValue: Partial<T>): void { this.value = Object.assign({}, this.value, newValue); } }