feat(core): add play button component (#383)

This commit is contained in:
rahim
2026-02-04 00:33:14 +11:00
committed by GitHub
parent 9fa172e8a4
commit 9cfab264d8
41 changed files with 2083 additions and 38 deletions
+2 -4
View File
@@ -20,9 +20,7 @@ const stateContext: StateContext<unknown> = {
* selectPlayback(store.state); // { paused, play, pause, ... } | undefined
* ```
*/
export function createSelector<S extends AnySlice>(
slice: S
): (state: Record<string, unknown>) => InferSliceState<S> | undefined {
export function createSelector<S extends AnySlice>(slice: S): (state: object) => InferSliceState<S> | undefined {
const initialState = slice.state(stateContext);
const keys = Object.keys(initialState as object);
@@ -32,6 +30,6 @@ export function createSelector<S extends AnySlice>(
return (state) => {
// WARN: Could be the source of a bug if two slices have overlapping state keys
if (!(firstKey in state)) return undefined;
return pick(state, keys) as InferSliceState<S>;
return pick(state as Record<string, unknown>, keys) as InferSliceState<S>;
};
}