• 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 as the same as Graffiti.discover, only they can also be Refs or getters. As they 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<undefined | null | GraffitiSession>

      If the session is undefined, the global session, $graffitiSession, will be used. Otherwise, the provided value will be used.

    Returns {
        isPolling: Ref<boolean>;
        poll: () => Promise<void>;
        results: Ref<
            (
                GraffitiObjectBase & $Resolve<
                    JSONSchema extends Schema & {
                        properties: {
                            actor: { type: "string" };
                            allowed: { items: { type: ... }; nullable: true; type: "array" };
                            channels: { items: { type: ... }; type: "array" };
                            lastModified: { type: "number" };
                            name: { type: "string" };
                            source: { type: "string" };
                            tombstone: { type: "boolean" };
                            value: { type: "object" };
                        };
                        required: readonly [
                            "value",
                            "channels",
                            "actor",
                            "name",
                            "source",
                            "lastModified",
                            "tombstone",
                        ];
                        type: "object";
                    }
                        ? Any
                        : (
                            Schema & {
                                properties: {
                                    actor: { type: ... };
                                    allowed: { items: ...; nullable: ...; type: ... };
                                    channels: { items: ...; type: ... };
                                    lastModified: { type: ... };
                                    name: { type: ... };
                                    source: { type: ... };
                                    tombstone: { type: ... };
                                    value: { type: ... };
                                };
                                required: readonly [
                                    "value",
                                    "channels",
                                    "actor",
                                    "name",
                                    "source",
                                    "lastModified",
                                    "tombstone",
                                ];
                                type: "object";
                            }
                        ) extends string
                        | true
                            ? Any
                            : (
                                Schema & {
                                    properties: {
                                        actor: ...;
                                        allowed: ...;
                                        channels: ...;
                                        lastModified: ...;
                                        name: ...;
                                        source: ...;
                                        tombstone: ...;
                                        value: ...;
                                    };
                                    required: readonly [(...), (...), (...), (...), (...), (...), (...)];
                                    type: "object";
                                }
                            ) extends false
                                ? Never
                                : (Schema & { properties: ...; required: ...; type: ... }) extends NullableSchema
                                    ?
                                        | ParseNullableSchema<(...), (...), (...)>
                                        | ParseNullableSchema<(...), (...), (...)>
                                        | ParseNullableSchema<(...), (...), (...)>
                                    : ((...) & (...)) extends ReferencingSchema
                                        ? ParseReferenceSchema<(...), (...), (...)>
                                        : (...) extends (...) ? (...) : (...),
                    ResolveDefaultOptions,
                > & { tombstone: false }
            )[],
        >;
    }