♻️ Add version reading by package file
This commit is contained in:
15
src/tools/client/zustands/usePackageAttributesStore.ts
Normal file
15
src/tools/client/zustands/usePackageAttributesStore.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import create from 'zustand';
|
||||
|
||||
import { ServerSidePackageAttributesType } from '../../server/getPackageVersion';
|
||||
|
||||
interface PackageAttributesState {
|
||||
attributes: ServerSidePackageAttributesType;
|
||||
setInitialPackageAttributes: (attributes: ServerSidePackageAttributesType) => void;
|
||||
}
|
||||
|
||||
export const usePackageAttributesStore = create<PackageAttributesState>((set) => ({
|
||||
attributes: { packageVersion: undefined, environment: 'test' },
|
||||
setInitialPackageAttributes(attributes) {
|
||||
set((state) => ({ ...state, attributes }));
|
||||
},
|
||||
}));
|
||||
Reference in New Issue
Block a user