Skip to content

ts type #5

@zhihengGet

Description

@zhihengGet

Hello !

  1. seem like the type for event.subscribe is wrong ? the correct type EventListener's args is Custom Event not event

export interface TurboQuery {
/**
* Configures the current instance of turbo query.
*/
readonly configure: (options?: Partial<TurboQueryConfiguration>) => void
/**
* Fetches the key information using a fetcher.
* The returned promise contains the result item.
*/
readonly query: <T = unknown>(key: string, options?: TurboQueryOptions<T>) => Promise<T>
/**
* Subscribes to a given event on a key. The event handler
* does have a payload parameter that will contain relevant
* information depending on the event type.
*/
readonly subscribe: (key: string, event: TurboQueryEvent, listener: EventListener) => Unsubscriber
/**
* Mutates the key with a given optimistic value.
* The mutated value is considered expired and will be
* replaced immediatly if a refetch happens.
*/
readonly mutate: <T = unknown>(key: string, item: TurboMutateValue<T>) => void

  1. can you export the type for ResolversCacheItem and others ? i can get them through some TS code but it would be helpful too have all types exported to use custom cache or custom resolver

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions