mirror of
https://github.com/cosscom/coss.git
synced 2026-09-14 20:06:50 +08:00
17 lines
365 B
TypeScript
17 lines
365 B
TypeScript
import { useAtom } from "jotai";
|
|
import { atomWithStorage } from "jotai/utils";
|
|
|
|
type Config = {
|
|
packageManager: "npm" | "yarn" | "pnpm" | "bun";
|
|
installationType: "cli" | "manual";
|
|
};
|
|
|
|
const configAtom = atomWithStorage<Config>("config", {
|
|
installationType: "cli",
|
|
packageManager: "pnpm",
|
|
});
|
|
|
|
export function useConfig() {
|
|
return useAtom(configAtom);
|
|
}
|