✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.
import { create } from "zustand";
interface JsonActions {
setJson: (json: string) => void;
getJson: () => string;
clear: () => void;
}
const initialStates = {
json: "{}",
loading: true,
};
export type JsonStates = typeof initialStates;
const useJson = create<JsonStates & JsonActions>()((set, get) => ({
...initialStates,
getJson: () => get().json,
setJson: json => {
set({ json, loading: false });
},
clear: () => {
set({ json: "", loading: false });
},
}));
export default useJson;