-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow using _Query_ with
initialData
in keepFresh
- Loading branch information
1 parent
8bf8b77
commit fa0727a
Showing
3 changed files
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@farfetched/core': patch | ||
--- | ||
|
||
Allow using _Query_ with `initialData` in `keepFresh` |
14 changes: 14 additions & 0 deletions
14
packages/core/src/trigger_api/__test__/keep_fresh.test-d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { describe, test } from 'vitest'; | ||
|
||
import { Query } from '../../query/type'; | ||
import { keepFresh } from '../keep_fresh'; | ||
|
||
describe('keepFresh', () => { | ||
test('supports Query with initialData', () => { | ||
const q = {} as unknown as Query<number, string, string, string>; | ||
|
||
keepFresh(q, { automatically: true }); | ||
keepFresh(q, { triggers: [] }); | ||
keepFresh(q, { automatically: true, triggers: [] }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters