Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts type #5

Open
zhihengGet opened this issue Jun 4, 2024 · 0 comments
Open

ts type #5

zhihengGet opened this issue Jun 4, 2024 · 0 comments

Comments

@zhihengGet
Copy link

zhihengGet commented Jun 4, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant