Skip to content

refactor(store): use Record as Store generic #3158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions modules/store/spec/types/feature_creator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,7 @@ describe('createFeature()', () => {
let store!: Store;
const counterState$ = store.select(selectCounterState);
const count$ = store.select(selectCount);
`).toFail(
/Type 'object' is not assignable to type '{ counter: { count: number; }; }'/
);
`).toFail(/No overload matches this call/);
});

it('should allow use with typed store.select', () => {
Expand Down
2 changes: 1 addition & 1 deletion modules/store/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ReducerManager } from './reducer_manager';
import { StateObservable } from './state';

@Injectable()
export class Store<T = object>
export class Store<T = Record<string, unknown>>
extends Observable<T>
implements Observer<Action>
{
Expand Down