♻️ Add version reading by package file

This commit is contained in:
Manuel committed 2023-01-31 21:58:55 +01:00
1 parent 2b76ae83b1
commit 2b20cecb79
19 files changed
+83 -36

No files matched your search

@@ -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 }));
},
}));