Skip to content

Commit

Permalink
Remove LocalStorageStore, type fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks committed Feb 5, 2021
1 parent 53da75d commit cc19152
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 112 deletions.
36 changes: 0 additions & 36 deletions src/LocalStorageStore.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/MergedStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ObservableStore } from './ObservableStore';

export class MergedStore<T> extends ObservableStore<T> {
export class MergedStore<T extends Record<string, unknown>> extends ObservableStore<T> {

private _children: ObservableStore<Partial<T>>[];

Expand Down
11 changes: 3 additions & 8 deletions src/ObservableStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ export class ObservableStore<T> extends SafeEventEmitter {

private _state: T;

constructor(initState: T) {
// Typecast/default: Preserve existing behavior
constructor(initState: T = {} as unknown as T) {
super();

if (initState) {
this._state = initState;
} else {
// Typecast: Preserve existing behavior
this._state = {} as unknown as T;
}
this._state = initState;
}

// wrapper around internal getState
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './asStream';
export * from './ComposedStore';
export * from './LocalStorageStore';
export * from './MergedStore';
export * from './ObservableStore';
export * from './transform';
66 changes: 0 additions & 66 deletions test/localStorage.js

This file was deleted.

0 comments on commit cc19152

Please sign in to comment.