redux-app-examples
Version:
Examples of redux-app with Angular and React.
22 lines (18 loc) • 465 B
text/typescript
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;
}
public setValue(newValue: T): void {
this.value = newValue;
}
public updateValue(newValue: Partial<T>): void {
this.value = Object.assign({}, this.value, newValue);
}
}