tinybase 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/debug/ui-react.js +2 -2
- package/lib/types/persisters.d.ts +2 -2
- package/lib/types/store.d.ts +1 -1
- package/lib/types/ui-react.d.ts +4 -3
- package/package.json +1 -1
- package/readme.md +1 -1
package/lib/debug/ui-react.js
CHANGED
|
@@ -135,8 +135,8 @@ const useSetCallback = (
|
|
|
135
135
|
return useCallback(
|
|
136
136
|
(parameter) =>
|
|
137
137
|
ifNotUndefined(store, (store2) =>
|
|
138
|
-
ifNotUndefined(get(parameter, store2), (
|
|
139
|
-
then(store2['set' + settable](...args,
|
|
138
|
+
ifNotUndefined(get(parameter, store2), (thing) =>
|
|
139
|
+
then(store2['set' + settable](...args, thing), thing),
|
|
140
140
|
),
|
|
141
141
|
),
|
|
142
142
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -342,8 +342,8 @@ export interface Persister {
|
|
|
342
342
|
save(): Promise<Persister>;
|
|
343
343
|
|
|
344
344
|
/**
|
|
345
|
-
* The
|
|
346
|
-
* associated and persists it into storage, once, and then continuously.
|
|
345
|
+
* The startAutoSave method takes data from the Store with which the Persister
|
|
346
|
+
* is associated and persists it into storage, once, and then continuously.
|
|
347
347
|
*
|
|
348
348
|
* This method first runs a single call to the save method to ensure the data
|
|
349
349
|
* is in sync with the persisted storage. It then continues to watch for
|
package/lib/types/store.d.ts
CHANGED
|
@@ -1691,7 +1691,7 @@ export interface Store {
|
|
|
1691
1691
|
hasCell(tableId: Id, rowId: Id, cellId: Id): boolean;
|
|
1692
1692
|
|
|
1693
1693
|
/**
|
|
1694
|
-
* The
|
|
1694
|
+
* The hasValues method returns a boolean indicating whether any Values exist
|
|
1695
1695
|
* in the Store.
|
|
1696
1696
|
*
|
|
1697
1697
|
* @returns Whether any Values exist.
|
package/lib/types/ui-react.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
CellIdsListener,
|
|
30
30
|
CellListener,
|
|
31
31
|
MapCell,
|
|
32
|
+
MapValue,
|
|
32
33
|
Row,
|
|
33
34
|
RowIdsListener,
|
|
34
35
|
RowListener,
|
|
@@ -2088,10 +2089,10 @@ export function useSetPartialValuesCallback<Parameter>(
|
|
|
2088
2089
|
*/
|
|
2089
2090
|
export function useSetValueCallback<Parameter>(
|
|
2090
2091
|
valueId: Id,
|
|
2091
|
-
getValue: (parameter: Parameter, store: Store) => Value,
|
|
2092
|
+
getValue: (parameter: Parameter, store: Store) => Value | MapValue,
|
|
2092
2093
|
getValueDeps?: React.DependencyList,
|
|
2093
2094
|
storeOrStoreId?: StoreOrStoreId,
|
|
2094
|
-
then?: (store: Store, value: Value) => void,
|
|
2095
|
+
then?: (store: Store, value: Value | MapValue) => void,
|
|
2095
2096
|
thenDeps?: React.DependencyList,
|
|
2096
2097
|
): ParameterizedCallback<Parameter>;
|
|
2097
2098
|
|
|
@@ -7767,7 +7768,7 @@ export type IndexProps = {
|
|
|
7767
7768
|
};
|
|
7768
7769
|
|
|
7769
7770
|
/**
|
|
7770
|
-
*
|
|
7771
|
+
* SliceProps props are used for components that refer to a single Slice in an
|
|
7771
7772
|
* Index object, such as the SliceView component.
|
|
7772
7773
|
*
|
|
7773
7774
|
* @category Props
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -266,4 +266,4 @@ export const createShop: typeof createShopDecl = () => {
|
|
|
266
266
|
};
|
|
267
267
|
```
|
|
268
268
|
|
|
269
|
-
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>4.2kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>8.7kB</em>.</p><p>The <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>3.4kB</em>, the <a href="https://tinybase.org/api/tools/"><code>tools</code></a> module is <em>5.4kB</em>, and everything is fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">store</a></th><td>4.2kB</td><td>10.0kB</td><td>43.9kB</td><td>184.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>14.8kB</td><td>29.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.7kB</td><td>16.6kB</td><td>33.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships/">relationships</a></th><td>1.8kB</td><td>3.6kB</td><td>16.8kB</td><td>42.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries/">queries</a></th><td>2.6kB</td><td>5.5kB</td><td>24.9kB</td><td>106.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.5kB</td><td>3.0kB</td><td>12.5kB</td><td>33.4kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters/">persisters</a></th><td>0.8kB</td><td>1.7kB</td><td>5.2kB</td><td>27.
|
|
269
|
+
<section><h2 id="did-we-say-tiny">Did we say tiny?</h2><p>If you use the basic <a href="https://tinybase.org/api/store/"><code>store</code></a> module alone, you'll only add a gzipped <em>4.2kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>8.7kB</em>.</p><p>The <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just another <em>3.4kB</em>, the <a href="https://tinybase.org/api/tools/"><code>tools</code></a> module is <em>5.4kB</em>, and everything is fast. Life's easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured in the <a href="https://tinybase.org/guides/how-tinybase-is-built/architecture/">Architecture</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>.js.gz</th><th>.js</th><th>debug.js</th><th>.d.ts</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">store</a></th><td>4.2kB</td><td>10.0kB</td><td>43.9kB</td><td>184.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics/">metrics</a></th><td>1.8kB</td><td>3.6kB</td><td>14.8kB</td><td>29.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes/">indexes</a></th><td>1.9kB</td><td>3.7kB</td><td>16.6kB</td><td>33.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships/">relationships</a></th><td>1.8kB</td><td>3.6kB</td><td>16.8kB</td><td>42.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/queries/">queries</a></th><td>2.6kB</td><td>5.5kB</td><td>24.9kB</td><td>106.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints/">checkpoints</a></th><td>1.5kB</td><td>3.0kB</td><td>12.5kB</td><td>33.4kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters/">persisters</a></th><td>0.8kB</td><td>1.7kB</td><td>5.2kB</td><td>27.3kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/common/">common</a></th><td>0.1kB</td><td>0.1kB</td><td>0.1kB</td><td>3.5kB</td></tr><tr><th class="right">tinybase (all)</th><td>8.7kB</td><td>21.1kB</td><td>92.8kB</td><td>0.3kB</td></tr></tbody></table></div><section><h2 id="well-tested-and-documented">Well tested and documented.</h2><p>TinyBase has <em>100.0%</em> test coverage, including the code throughout the documentation - even on this page! The guides, demos, and API examples are designed to make it as easy as possible to get up and running.</p><p>Read more about how TinyBase is tested in the Unit <a href="https://tinybase.org/guides/how-tinybase-is-built/testing/">Testing</a> guide.</p></section><div class="table"><table class="fixed"><tbody><tr><th width="30%"> </th><th>Total</th><th>Tested</th><th>Coverage</th></tr><tr><th class="right">Lines</th><td>1,792</td><td>1,792</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,930</td><td>1,930</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>768</td><td>768</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>630</td><td>630</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">2,581</td></tr><tr><th class="right">Assertions</th><td colspan="3">12,421</td></tr></tbody></table></div><hr><p><a class="start" href="https://tinybase.org/guides/the-basics/getting-started/">Get started</a></p><p><a href="https://tinybase.org/demos/">Try the demos</a></p><p><a href="https://tinybase.org/api/store/interfaces/store/store/">Read the docs</a></p><hr><section><h2 id="follow">Follow</h2><ul><li>News and updates on <a href="https://twitter.com/tinybasejs">Twitter</a>, <a href="https://discord.com/invite/mGz3mevwP8">Discord</a>, and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://github.com/tinyplex/tinybase/discussions">Discussions</a> and <a href="https://github.com/tinyplex/tinybase/issues">issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li><li><a href="https://tinybase.org/guides/releases/">Release notes</a> for each version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/3.0.6">NPM</a>.</li></ul></section><section><h2 id="about">About</h2><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://hachyderm.io/@jamesgpearce">me</a> in API design, minification, and documentation. It could not have been built without these great <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#giants">projects</a> and <a href="https://tinybase.org/guides/how-tinybase-is-built/credits/#and-friends">friends</a>, and I hope you enjoy using it!</p></section>
|