Skip to content

Commit ad711f5

Browse files
committed
[docs] More tweaks
1 parent 304b570 commit ad711f5

3 files changed

Lines changed: 196 additions & 196 deletions

File tree

‎site/guides/02_building_uis/6_building_uis_with_svelte.md‎

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Building UIs With Svelte
22

3-
This guide describes how to use the `tinybase/ui-svelte` module to build
4-
reactive user interfaces in Svelte 5 applications.
3+
This guide describes how to use the ui-svelte module to build reactive user
4+
interfaces in Svelte 5 applications.
55

66
## Reactive Functions
77

8-
Every reactive function in the `ui-svelte` module returns a reactive object with
9-
a `current` property. Any part of your template that reads it will automatically
8+
Every reactive function in the ui-svelte module returns a reactive object with a
9+
`current` property. Any part of your template that reads it will automatically
1010
update when the underlying Store data changes.
1111

12-
Here is the `getCell` function reading the color of a pet and displaying it in a
12+
Here is the getCell function reading the color of a pet and displaying it in a
1313
paragraph:
1414

1515
```svelte
@@ -31,28 +31,31 @@ subscriptions, nor `$:` labels, nor `onDestroy` cleanup. The reactive object
3131
registers and removes TinyBase listeners automatically using Svelte's reactivity
3232
lifecycle.
3333

34-
There are reactive functions corresponding to every Store reading method:
35-
36-
- The getValues function is the reactive equivalent of the getValues method
37-
- The getValueIds function is the reactive equivalent of the getValueIds method
38-
- The getValue function is the reactive equivalent of the getValue method
39-
- The getTables function is the reactive equivalent of the getTables method
40-
- The getTableIds function is the reactive equivalent of the getTableIds method
41-
- The getTable function is the reactive equivalent of the getTable method
42-
- The getRowIds function is the reactive equivalent of the getRowIds method
43-
- The getSortedRowIds function is the reactive equivalent of the getSortedRowIds
44-
method
45-
- The getRow function is the reactive equivalent of the getRow method
46-
- The getCellIds function is the reactive equivalent of the getCellIds method
47-
- The getCell function is the reactive equivalent of the getCell method
34+
There are reactive functions corresponding to every Store reading method. For
35+
example:
36+
37+
| TinyBase Store | Svelte Reactive Function |
38+
| ---------------------- | ------------------------ |
39+
| getValues method | getValues function |
40+
| getValueIds method | getValueIds function |
41+
| getValue method | getValue function |
42+
| getTables method | getTables function |
43+
| getTableIds method | getTableIds function |
44+
| getTable method | getTable function |
45+
| getRowIds method | getRowIds function |
46+
| getSortedRowIds method | getSortedRowIds function |
47+
| getRow method | getRow function |
48+
| getCellIds method | getCellIds function |
49+
| getCell method | getCell function |
4850

4951
There are also reactive functions for the derived TinyBase data or objects.
5052
Examples include the getMetric function, getSliceRowIds function, or
5153
getResultTable function, and so on.
5254

5355
Functions that access higher-level TinyBase objects - like the getStore
54-
function, getMetrics function, and getQueries function - are different: they
55-
return TinyBase objects directly from a Provider context.
56+
function, getMetrics function, and getQueries function - are different: rather
57+
than returning a reactive object, they return TinyBase objects directly from a
58+
Provider context.
5659

5760
## Reactive Parameters With MaybeGetter
5861

‎site/guides/17_releases.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ underlying TinyBase data changes:
3030
<p>Color: {color.current}</p>
3131
```
3232

33-
The `getCell` function and the `getValue` function provide a writable `current`
33+
The getCell function and the getValue function provide a writable `current`
3434
property that pairs naturally with Svelte's `bind:` directive for two-way data
3535
binding:
3636

@@ -53,22 +53,22 @@ The module further includes a provider component and context helpers for sharing
5353
TinyBase objects across a component tree, and many built-in view components for
5454
assembling UIs directly from Store data.
5555

56-
Read more in the ui-svelte module documentation and the [Building UIs With
57-
Svelte](/guides/building-uis/building-uis-with-svelte/) guide.
56+
Read more in the ui-svelte module documentation and the Building UIs With
57+
Svelte guide.
5858

5959
## Breaking Changes
6060

6161
If you tried the ui-svelte module in earlier beta releases, there are some
6262
intentional breaking changes made to ensure the API is more idiomatic for
6363
Svelte. What was `useX` is now a reactive `getX` or `hasX` function, so for
6464
example `useCell` has become the getCell function and `useHasCell` has become
65-
the hasCell function. Context lookups also use `getX`, as with the
66-
getMetrics function, but those return TinyBase objects directly from Provider
67-
context rather than reactive `{current}` wrappers. Listener functions now use
68-
`onX`; so for example `useCellListener` has become the onCell function. The
69-
old `useBindableCell` and `useBindableValue` beta names have also gone away
70-
because the getCell function and getValue function expose the writable
71-
scalar accessors directly.
65+
the hasCell function. Context lookups also use `getX`, as with the getMetrics
66+
function, but those return TinyBase objects directly from Provider context
67+
rather than reactive `current`-based wrappers. Listener functions now use `onX`;
68+
so for example `useCellListener` has become the onCell function. The old
69+
`useBindableCell` and `useBindableValue` beta names have also gone away because
70+
the getCell function and getValue function expose the writable scalar accessors
71+
directly.
7272

7373
This release also contains a minor breaking change since v8.0. The
7474
`tinybase/omni` module no longer includes the ui-react module, ui-react-dom

0 commit comments

Comments
 (0)