You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 14, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+76-6Lines changed: 76 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,9 @@ Creates a TanStack Query that updates a Pocketbase record in realtime. View the
14
14
15
15
### Simple Example
16
16
17
+
<details>
18
+
<summary>View Code</summary>
19
+
17
20
```svelte
18
21
<script lang="ts">
19
22
import Pocketbase from 'pocketbase';
@@ -47,8 +50,13 @@ Creates a TanStack Query that updates a Pocketbase record in realtime. View the
47
50
{/if}
48
51
```
49
52
53
+
</details>
54
+
50
55
### With Query Params
51
56
57
+
<details>
58
+
<summary>View Code</summary>
59
+
52
60
```svelte
53
61
<script lang="ts">
54
62
import Pocketbase from 'pocketbase';
@@ -83,12 +91,17 @@ Creates a TanStack Query that updates a Pocketbase record in realtime. View the
83
91
{/if}
84
92
```
85
93
94
+
</details>
95
+
86
96
### Using SSR
87
97
88
98
Read [TanStack Query's docs on this](https://tanstack.com/query/v4/docs/svelte/ssr) first. The examples below are modified versions of the examples on that page.
Creates a TanStack Query that updates an array of Pocketbase records in realtime. View the JSDoc for the relevant functions for more documentation on their available options.
207
227
208
228
### Simple Example
209
229
230
+
<details>
231
+
<summary>View Code</summary>
232
+
210
233
```svelte
211
234
<script lang="ts">
212
235
import Pocketbase from 'pocketbase';
@@ -239,8 +262,13 @@ Creates a TanStack Query that updates an array of Pocketbase records in realtime
239
262
{/if}
240
263
```
241
264
265
+
</details>
266
+
242
267
### With Query Params
243
268
269
+
<details>
270
+
<summary>View Code</summary>
271
+
244
272
```svelte
245
273
<script lang="ts">
246
274
import Pocketbase from 'pocketbase';
@@ -261,9 +289,9 @@ Creates a TanStack Query that updates an array of Pocketbase records in realtime
261
289
sort: '-created', // sort by date created, descending
262
290
filter: 'created >= "2022-01-01 00:00:00"'
263
291
},
264
-
// sortFunction and filterFunction are applied after a realtime update is applied
292
+
// sortFunction and filterFunction are applied after a realtime update is applied
265
293
sortFunction: (a, b) => new Date(a.created) - new Date(b.created) // sort by date created, descending
266
-
filterFunction: (record) => new Date(record.created) >= new Date("2022-01-01 00:00:00")
294
+
filterFunction: (record) => new Date(record.created) >= new Date("2022-01-01 00:00:00")
267
295
}
268
296
);
269
297
</script>
@@ -286,12 +314,17 @@ Creates a TanStack Query that updates an array of Pocketbase records in realtime
286
314
{/if}
287
315
```
288
316
317
+
</details>
318
+
289
319
### Using SSR
290
320
291
321
Read [TanStack Query's docs on this](https://tanstack.com/query/v4/docs/svelte/ssr) first. The examples below are modified versions of the examples on that page.
Creates a TanStack Infinite Query that updates paginated Pocketbase records in realtime. View the JSDoc for the relevant functions for more documentation on their available options.
406
446
407
447
### Simple Example
408
448
449
+
<details>
450
+
<summary>View Code</summary>
451
+
409
452
```svelte
410
453
<script lang="ts">
411
454
import Pocketbase from 'pocketbase';
@@ -447,8 +490,13 @@ Creates a TanStack Infinite Query that updates paginated Pocketbase records in r
447
490
{/if}
448
491
```
449
492
493
+
</details>
494
+
450
495
### With Query Params
451
496
497
+
<details>
498
+
<summary>View Code</summary>
499
+
452
500
```svelte
453
501
<script lang="ts">
454
502
import Pocketbase from 'pocketbase';
@@ -469,9 +517,9 @@ Creates a TanStack Infinite Query that updates paginated Pocketbase records in r
469
517
sort: '-created', // sort by date created, descending
470
518
filter: 'created >= "2022-01-01 00:00:00"'
471
519
},
472
-
// sortFunction and filterFunction are applied after a realtime update is applied
520
+
// sortFunction and filterFunction are applied after a realtime update is applied
473
521
sortFunction: (a, b) => new Date(a.created) - new Date(b.created) // sort by date created, descending
474
-
filterFunction: (record) => new Date(record.created) >= new Date("2022-01-01 00:00:00")
522
+
filterFunction: (record) => new Date(record.created) >= new Date("2022-01-01 00:00:00")
475
523
}
476
524
);
477
525
</script>
@@ -503,12 +551,17 @@ Creates a TanStack Infinite Query that updates paginated Pocketbase records in r
503
551
{/if}
504
552
```
505
553
554
+
</details>
555
+
506
556
### Using SSR
507
557
508
558
Read [TanStack Query's docs on this](https://tanstack.com/query/v4/docs/svelte/ssr) first. The examples below are modified versions of the examples on that page.
0 commit comments