How to use the @sanity/mutator.Patcher function in @sanity/mutator

To help you get started, we’ve selected a few @sanity/mutator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sanity-io / sanity / packages / @sanity / document-store / examples / mock-db / db.js View on Github external
function applyPatch(patch) {
  const record = getRecord(patch.id)
  const prevDocument = record.snapshot
  return new Patcher(patch).apply(prevDocument)
}
function applyPatches(patches) {
github sanity-io / sanity / packages / @sanity / block-editor / demo-server / components / Main.js View on Github external
        (acc, patch) => new Patcher(patch).applyViaAccessor(acc),
        this.state.value
github sanity-io / sanity / packages / @sanity / form-builder / src / inputs / BlockEditor-slate / applySanityPatches.js View on Github external
gradientPatches.forEach(gPatch => {
    nextValue = new Patcher(gPatch).applyViaAccessor(nextValue)
  })
  return nextValue.getAttribute(FAKE_KEY)

@sanity/mutator

A set of models to make it easier to utilize the powerful real time collaborative features of Sanity

MIT
Latest version published 3 days ago

Package Health Score

98 / 100
Full package analysis