Files
OpenPipe-llm/app/src/state/persist.ts
Kyle Corbitt 5ed7adadf9 Better scenario variable editing
Some users have gotten confused by the scenario variable editing interface. This change makes the interface easier to understand.
2023-08-10 12:08:17 -07:00

14 lines
379 B
TypeScript

import { type PersistOptions } from "zustand/middleware/persist";
import { type State } from "./store";
export const stateToPersist = {
selectedProjectId: null as string | null,
};
export const persistOptions: PersistOptions<State, typeof stateToPersist> = {
name: "persisted-app-store",
partialize: (state) => ({
selectedProjectId: state.selectedProjectId,
}),
};