Sanity Library Reference Docs
    Preparing search index...

    Function prepend

    • Creates an insert operation that prepends the provided items.

      Returns any

      An insert operation for adding a value to the start of an array. https://www.sanity.io/docs/http-patches#refAUsf0

      const prependFoo = prepend('foo')
      const prependObject = prepend({name: 'foo'})
      const prependObjects = prepend([{name: 'foo'}, [{name: 'bar'}]])