This repository has been archived on 2025-05-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Astral-nook/resources/scripts/state/server/files.ts
2020-07-10 23:09:37 -07:00

17 lines
396 B
TypeScript

import { action, Action } from 'easy-peasy';
import { cleanDirectoryPath } from '@/helpers';
export interface ServerFileStore {
directory: string;
setDirectory: Action<ServerFileStore, string>;
}
const files: ServerFileStore = {
directory: '/',
setDirectory: action((state, payload) => {
state.directory = cleanDirectoryPath(payload);
}),
};
export default files;