🐛 Fix deprecated zustand dependencies
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { create } from 'zustand';
|
||||
import { createWithEqualityFn } from 'zustand/traditional';
|
||||
|
||||
import { ServerSidePackageAttributesType } from '../../server/getPackageVersion';
|
||||
|
||||
@@ -7,9 +7,12 @@ interface PackageAttributesState {
|
||||
setInitialPackageAttributes: (attributes: ServerSidePackageAttributesType) => void;
|
||||
}
|
||||
|
||||
export const usePackageAttributesStore = create<PackageAttributesState>((set) => ({
|
||||
attributes: { packageVersion: undefined, environment: 'test', dependencies: {} },
|
||||
setInitialPackageAttributes(attributes) {
|
||||
set((state) => ({ ...state, attributes }));
|
||||
},
|
||||
}));
|
||||
export const usePackageAttributesStore = createWithEqualityFn<PackageAttributesState>(
|
||||
(set) => ({
|
||||
attributes: { packageVersion: undefined, environment: 'test', dependencies: {} },
|
||||
setInitialPackageAttributes(attributes) {
|
||||
set((state) => ({ ...state, attributes }));
|
||||
},
|
||||
}),
|
||||
Object.is
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user