for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import {IObserverAdapter, IOnChangeCallback} from '@enbock/state-value-observer/Observer';
export default class StorageAdapter<T> implements IObserverAdapter<T> {
protected baseAdapter: IObserverAdapter<T>;
protected onChangeCallback: IOnChangeCallback<T>;
constructor(baseAdapter: IObserverAdapter<T>, onChangeCallback: IOnChangeCallback<T>) {
this.baseAdapter = baseAdapter;
this.onChangeCallback = onChangeCallback;
}
onChange(newValue: T): void {
this.onChangeCallback(newValue);
this.baseAdapter.onChange(newValue);