14 lines
401 B
TypeScript
14 lines
401 B
TypeScript
import { selector } from 'pipestate';
|
|
import { FormatSettingsAtom } from './atoms';
|
|
|
|
export const FpsSelector = selector<number, []>({
|
|
get: ({ get }) => {
|
|
return get(FormatSettingsAtom).fps;
|
|
},
|
|
set: ({ set, get }, newFps) => {
|
|
const formatSettings = get(FormatSettingsAtom);
|
|
set(FormatSettingsAtom, { ...formatSettings, fps: newFps });
|
|
},
|
|
dependencies: [FormatSettingsAtom],
|
|
});
|