refactor(store): v2 (#362)

This commit is contained in:
rahim
2026-01-31 23:34:11 +11:00
committed by GitHub
parent 9c725803a6
commit fe892cb911
64 changed files with 1883 additions and 2959 deletions
@@ -1,6 +1,6 @@
import { render } from '@testing-library/react';
import { createFeature } from '@videojs/store';
import { defineFeature } from '@videojs/store';
import { createStore, useStoreContext } from '@videojs/store/react';
import { describe, expect, it, vi } from 'vitest';
@@ -12,14 +12,16 @@ describe('video', () => {
muted = false;
}
const mockFeature = createFeature<MockMedia>()({
initialState: { volume: 1, muted: false },
const mockFeature = defineFeature<MockMedia>()({
state: () => ({
volume: 1,
muted: false,
}),
getSnapshot: ({ target }) => ({
volume: target.volume,
muted: target.muted,
}),
subscribe: () => {},
request: {},
});
function createTestStore() {