-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: support functional optimisticData #1861
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 377efaa:
|
* feat: support functional optimisticData * Update src/types.ts Co-authored-by: Shu Ding <g@shud.in>
It’s included in 1.3.0 🎉 |
* feat: support functional optimisticData * Update src/types.ts Co-authored-by: Shu Ding <g@shud.in>
* feat: support functional optimisticData * Update src/types.ts Co-authored-by: Shu Ding <g@shud.in>
@@ -145,7 +145,7 @@ export type MutatorCallback<Data = any> = ( | |||
export type MutatorOptions<Data = any> = { | |||
revalidate?: boolean | |||
populateCache?: boolean | ((result: any, currentData: Data) => Data) | |||
optimisticData?: Data | |||
optimisticData?: Data | ((currentData?: Data) => Data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool feature! ;)
Shouldn't this be ((currentData?: Data) => Data|undefined)
Resolves #1858