next-sanity
Version:
Sanity.io toolkit for Next.js
31 lines (30 loc) • 1.41 kB
JavaScript
import "@sanity/comlink";
import "@sanity/presentation-comlink";
const perspectiveListeners = /* @__PURE__ */ new Set();
let perspective = "checking";
function setPerspective(nextPerspective) {
if (perspective.toString() === nextPerspective.toString()) return;
perspective = nextPerspective;
for (const onPerspectiveChange of perspectiveListeners) onPerspectiveChange();
}
const environmentListeners = /* @__PURE__ */ new Set();
let environment = "checking";
function setEnvironment(nextEnvironment) {
environment = nextEnvironment;
for (const onEnvironmentChange of environmentListeners) onEnvironmentChange();
}
const comlinkListeners = /* @__PURE__ */ new Set();
let comlink = null;
let comlinkProjectId = null;
let comlinkDataset = null;
function setComlink(nextComlink) {
comlink = nextComlink;
for (const onComlinkChange of comlinkListeners) onComlinkChange();
}
function setComlinkClientConfig(nextComlinkProjectId, nextComlinkDataset) {
comlinkProjectId = nextComlinkProjectId;
comlinkDataset = nextComlinkDataset;
for (const onComlinkChange of comlinkListeners) onComlinkChange();
}
export { environment as a, perspectiveListeners as c, setEnvironment as d, setPerspective as f, comlinkProjectId as i, setComlink as l, comlinkDataset as n, environmentListeners as o, comlinkListeners as r, perspective as s, comlink as t, setComlinkClientConfig as u };
//# sourceMappingURL=context.js.map