mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor(store): v2 (#362)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user