@graffiti-garden/wrapper-vue
    Preparing search index...

    Function useGraffitiDiscover

    • The Graffiti.discover method as a reactive composable for use in the Vue composition API.

      Its corresponding renderless component is GraffitiDiscover.

      The arguments of this composable are largely the same as Graffiti.discover, only they can also be Refs or getters. There is one additional optional argument autopoll, which when true, will automatically poll for new objects. As they change the arguments change, the output will automatically update. Reactivity only triggers when the root array or object changes, not when the elements or properties change. If you need deep reactivity, wrap your argument in a getter.

      Type Parameters

      • Schema extends JSONSchema

      Parameters

      • channels: MaybeRefOrGetter<string[]>
      • schema: MaybeRefOrGetter<Schema>
      • Optionalsession: MaybeRefOrGetter<GraffitiSession | null | undefined>
      • Optionalautopoll: MaybeRefOrGetter<boolean>

        Whether to automatically poll for new objects.

      Returns {
          isFirstPoll: Ref<boolean, boolean>;
          objects: Ref<GraffitiObject<Schema>[], GraffitiObject<Schema>[]>;
          poll: () => Promise<void>;
      }

      • objects: A ref that contains an array of Graffiti objects.
      • poll: A function that can be called to manually check for objects.
      • isFirstPoll: A boolean ref that indicates if the first poll after a change of arguments is currently running. It may be used to show a loading spinner or disable a button, or it can be watched to know when the objects array is ready to use.