tinybase 1.3.4 → 1.3.5
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/store.d.ts +9 -1
- package/lib/store.d.ts +9 -1
- package/package.json +22 -22
- package/readme.md +1 -1
package/lib/debug/store.d.ts
CHANGED
|
@@ -390,6 +390,7 @@ export type CellListener = (
|
|
|
390
390
|
* @param cellId The Id of the Cell that was being changed.
|
|
391
391
|
* @param invalidCells An array of the values of the Cell that were invalid.
|
|
392
392
|
* @category Listener
|
|
393
|
+
* @since v1.1.0
|
|
393
394
|
*/
|
|
394
395
|
export type InvalidCellListener = (
|
|
395
396
|
store: Store,
|
|
@@ -521,6 +522,7 @@ export type CellSchema =
|
|
|
521
522
|
* different value and then changed back.
|
|
522
523
|
*
|
|
523
524
|
* @category Transaction
|
|
525
|
+
* @since v1.2.0
|
|
524
526
|
*/
|
|
525
527
|
export type ChangedCells = {
|
|
526
528
|
[tableId: Id]: {
|
|
@@ -543,6 +545,7 @@ export type ChangedCells = {
|
|
|
543
545
|
* change a Cell during the transaction are described.
|
|
544
546
|
*
|
|
545
547
|
* @category Transaction
|
|
548
|
+
* @since v1.2.0
|
|
546
549
|
*/
|
|
547
550
|
export type InvalidCells = {
|
|
548
551
|
[tableId: Id]: {
|
|
@@ -1710,7 +1713,7 @@ export interface Store {
|
|
|
1710
1713
|
*
|
|
1711
1714
|
* @param actions The function to be executed as a transaction.
|
|
1712
1715
|
* @param doRollback An optional callback that should return `true` if you
|
|
1713
|
-
* want to rollback the transaction at the end.
|
|
1716
|
+
* want to rollback the transaction at the end. Since v1.2.0.
|
|
1714
1717
|
* @returns Whatever value the provided transaction function returns.
|
|
1715
1718
|
* @example
|
|
1716
1719
|
* This example makes changes to two Cells, first outside, and secondly
|
|
@@ -1846,6 +1849,7 @@ export interface Store {
|
|
|
1846
1849
|
* // -> 'Fido changed'
|
|
1847
1850
|
* ```
|
|
1848
1851
|
* @category Transaction
|
|
1852
|
+
* @since v1.3.0
|
|
1849
1853
|
*/
|
|
1850
1854
|
startTransaction(): Store;
|
|
1851
1855
|
|
|
@@ -1923,6 +1927,7 @@ export interface Store {
|
|
|
1923
1927
|
* // -> {pets: {fido: {species: 'dog', color: 'brown'}}}
|
|
1924
1928
|
* ```
|
|
1925
1929
|
* @category Transaction
|
|
1930
|
+
* @since v1.3.0
|
|
1926
1931
|
*/
|
|
1927
1932
|
finishTransaction(
|
|
1928
1933
|
doRollback?: (
|
|
@@ -2897,6 +2902,7 @@ export interface Store {
|
|
|
2897
2902
|
* store.delListener(listenerId);
|
|
2898
2903
|
* ```
|
|
2899
2904
|
* @category Listener
|
|
2905
|
+
* @since v1.1.0
|
|
2900
2906
|
*/
|
|
2901
2907
|
addInvalidCellListener(
|
|
2902
2908
|
tableId: IdOrNull,
|
|
@@ -2971,6 +2977,7 @@ export interface Store {
|
|
|
2971
2977
|
* store.delListener(listenerId).delListener(listenerId2);
|
|
2972
2978
|
* ```
|
|
2973
2979
|
* @category Listener
|
|
2980
|
+
* @since v1.3.0
|
|
2974
2981
|
*/
|
|
2975
2982
|
addWillFinishTransactionListener(listener: TransactionListener): Id;
|
|
2976
2983
|
|
|
@@ -3040,6 +3047,7 @@ export interface Store {
|
|
|
3040
3047
|
* store.delListener(listenerId).delListener(listenerId2);
|
|
3041
3048
|
* ```
|
|
3042
3049
|
* @category Listener
|
|
3050
|
+
* @since v1.3.0
|
|
3043
3051
|
*/
|
|
3044
3052
|
addDidFinishTransactionListener(listener: TransactionListener): Id;
|
|
3045
3053
|
|
package/lib/store.d.ts
CHANGED
|
@@ -390,6 +390,7 @@ export type CellListener = (
|
|
|
390
390
|
* @param cellId The Id of the Cell that was being changed.
|
|
391
391
|
* @param invalidCells An array of the values of the Cell that were invalid.
|
|
392
392
|
* @category Listener
|
|
393
|
+
* @since v1.1.0
|
|
393
394
|
*/
|
|
394
395
|
export type InvalidCellListener = (
|
|
395
396
|
store: Store,
|
|
@@ -521,6 +522,7 @@ export type CellSchema =
|
|
|
521
522
|
* different value and then changed back.
|
|
522
523
|
*
|
|
523
524
|
* @category Transaction
|
|
525
|
+
* @since v1.2.0
|
|
524
526
|
*/
|
|
525
527
|
export type ChangedCells = {
|
|
526
528
|
[tableId: Id]: {
|
|
@@ -543,6 +545,7 @@ export type ChangedCells = {
|
|
|
543
545
|
* change a Cell during the transaction are described.
|
|
544
546
|
*
|
|
545
547
|
* @category Transaction
|
|
548
|
+
* @since v1.2.0
|
|
546
549
|
*/
|
|
547
550
|
export type InvalidCells = {
|
|
548
551
|
[tableId: Id]: {
|
|
@@ -1710,7 +1713,7 @@ export interface Store {
|
|
|
1710
1713
|
*
|
|
1711
1714
|
* @param actions The function to be executed as a transaction.
|
|
1712
1715
|
* @param doRollback An optional callback that should return `true` if you
|
|
1713
|
-
* want to rollback the transaction at the end.
|
|
1716
|
+
* want to rollback the transaction at the end. Since v1.2.0.
|
|
1714
1717
|
* @returns Whatever value the provided transaction function returns.
|
|
1715
1718
|
* @example
|
|
1716
1719
|
* This example makes changes to two Cells, first outside, and secondly
|
|
@@ -1846,6 +1849,7 @@ export interface Store {
|
|
|
1846
1849
|
* // -> 'Fido changed'
|
|
1847
1850
|
* ```
|
|
1848
1851
|
* @category Transaction
|
|
1852
|
+
* @since v1.3.0
|
|
1849
1853
|
*/
|
|
1850
1854
|
startTransaction(): Store;
|
|
1851
1855
|
|
|
@@ -1923,6 +1927,7 @@ export interface Store {
|
|
|
1923
1927
|
* // -> {pets: {fido: {species: 'dog', color: 'brown'}}}
|
|
1924
1928
|
* ```
|
|
1925
1929
|
* @category Transaction
|
|
1930
|
+
* @since v1.3.0
|
|
1926
1931
|
*/
|
|
1927
1932
|
finishTransaction(
|
|
1928
1933
|
doRollback?: (
|
|
@@ -2897,6 +2902,7 @@ export interface Store {
|
|
|
2897
2902
|
* store.delListener(listenerId);
|
|
2898
2903
|
* ```
|
|
2899
2904
|
* @category Listener
|
|
2905
|
+
* @since v1.1.0
|
|
2900
2906
|
*/
|
|
2901
2907
|
addInvalidCellListener(
|
|
2902
2908
|
tableId: IdOrNull,
|
|
@@ -2971,6 +2977,7 @@ export interface Store {
|
|
|
2971
2977
|
* store.delListener(listenerId).delListener(listenerId2);
|
|
2972
2978
|
* ```
|
|
2973
2979
|
* @category Listener
|
|
2980
|
+
* @since v1.3.0
|
|
2974
2981
|
*/
|
|
2975
2982
|
addWillFinishTransactionListener(listener: TransactionListener): Id;
|
|
2976
2983
|
|
|
@@ -3040,6 +3047,7 @@ export interface Store {
|
|
|
3040
3047
|
* store.delListener(listenerId).delListener(listenerId2);
|
|
3041
3048
|
* ```
|
|
3042
3049
|
* @category Listener
|
|
3050
|
+
* @since v1.3.0
|
|
3043
3051
|
*/
|
|
3044
3052
|
addDidFinishTransactionListener(listener: TransactionListener): Id;
|
|
3045
3053
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinybase",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.5",
|
|
4
4
|
"author": "jamesgpearce",
|
|
5
5
|
"repository": "github:tinyplex/tinybase",
|
|
6
6
|
"license": "MIT",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@babel/cli": "^7.17.10",
|
|
62
|
-
"@babel/core": "^7.
|
|
63
|
-
"@babel/preset-env": "^7.
|
|
64
|
-
"@babel/preset-react": "^7.
|
|
65
|
-
"@babel/preset-typescript": "^7.
|
|
62
|
+
"@babel/core": "^7.18.2",
|
|
63
|
+
"@babel/preset-env": "^7.18.2",
|
|
64
|
+
"@babel/preset-react": "^7.17.12",
|
|
65
|
+
"@babel/preset-typescript": "^7.17.12",
|
|
66
66
|
"@rollup/plugin-replace": "^4.0.0",
|
|
67
67
|
"@types/asciichart": "^1.5.6",
|
|
68
68
|
"@types/expect-puppeteer": "^4.4.7",
|
|
69
69
|
"@types/http-server": "^0.12.1",
|
|
70
|
-
"@types/jest": "^
|
|
70
|
+
"@types/jest": "^28.1.1",
|
|
71
71
|
"@types/jest-environment-puppeteer": "^5.0.2",
|
|
72
72
|
"@types/less": "^3.0.3",
|
|
73
73
|
"@types/puppeteer": "^5.4.6",
|
|
@@ -75,35 +75,35 @@
|
|
|
75
75
|
"@types/react-dom": "^17.0.14",
|
|
76
76
|
"@types/react-test-renderer": "^17.0.1",
|
|
77
77
|
"@types/tmp": "^0.2.3",
|
|
78
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
79
|
-
"@typescript-eslint/parser": "^5.
|
|
78
|
+
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
79
|
+
"@typescript-eslint/parser": "^5.27.1",
|
|
80
80
|
"asciichart": "^1.5.25",
|
|
81
81
|
"babel-eslint": "^10.1.0",
|
|
82
|
-
"babel-jest": "^28.1.
|
|
82
|
+
"babel-jest": "^28.1.1",
|
|
83
83
|
"babel-preset-minify": "^0.5.2",
|
|
84
84
|
"country-flag-emoji-json": "^2.0.0",
|
|
85
|
-
"cspell": "^
|
|
86
|
-
"esbuild": "^0.14.
|
|
87
|
-
"eslint": "^8.
|
|
85
|
+
"cspell": "^6.1.2",
|
|
86
|
+
"esbuild": "^0.14.43",
|
|
87
|
+
"eslint": "^8.17.0",
|
|
88
88
|
"eslint-config-prettier": "^8.5.0",
|
|
89
|
-
"eslint-plugin-jest": "^26.
|
|
90
|
-
"eslint-plugin-jsdoc": "^39.2
|
|
91
|
-
"eslint-plugin-react": "^7.
|
|
89
|
+
"eslint-plugin-jest": "^26.5.3",
|
|
90
|
+
"eslint-plugin-jsdoc": "^39.3.2",
|
|
91
|
+
"eslint-plugin-react": "^7.30.0",
|
|
92
92
|
"eslint-plugin-react-hooks": "^4.5.0",
|
|
93
93
|
"gulp": "^4.0.2",
|
|
94
94
|
"gulp-gzip": "^1.4.2",
|
|
95
|
-
"http-server": "^14.1.
|
|
96
|
-
"jest": "^28.1.
|
|
97
|
-
"jest-environment-jsdom": "^28.1.
|
|
95
|
+
"http-server": "^14.1.1",
|
|
96
|
+
"jest": "^28.1.1",
|
|
97
|
+
"jest-environment-jsdom": "^28.1.1",
|
|
98
98
|
"jest-fetch-mock": "^3.0.3",
|
|
99
99
|
"jest-puppeteer": "^6.1.0",
|
|
100
|
-
"less": "^4.1.
|
|
100
|
+
"less": "^4.1.3",
|
|
101
101
|
"prettier": "^2.6.2",
|
|
102
|
-
"puppeteer": "^14.
|
|
102
|
+
"puppeteer": "^14.3.0",
|
|
103
103
|
"react": "^17.0.2",
|
|
104
104
|
"react-dom": "^17.0.2",
|
|
105
105
|
"react-test-renderer": "^17.0.2",
|
|
106
|
-
"rollup": "^2.
|
|
106
|
+
"rollup": "^2.75.6",
|
|
107
107
|
"rollup-plugin-esbuild": "^4.9.1",
|
|
108
108
|
"rollup-plugin-gzip": "^3.0.1",
|
|
109
109
|
"rollup-plugin-prettier": "^2.2.2",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"tinydocs": "^0.1.13",
|
|
112
112
|
"tmp": "^0.2.1",
|
|
113
113
|
"ts-unused-exports": "^8.0.0",
|
|
114
|
-
"typescript": "4.
|
|
114
|
+
"typescript": "4.7.3"
|
|
115
115
|
},
|
|
116
116
|
"peerDependencies": {
|
|
117
117
|
"react": "^17.0.0"
|
package/readme.md
CHANGED
|
@@ -192,4 +192,4 @@ console.log(store.getCell('pets', 'felix', 'sold'));
|
|
|
192
192
|
// -> false
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
<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>3.0kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>6.0kB</em>. The <code>ui-react</code> adaptor is just another <em>2.6kB</em>, and everything is fast.</p><p>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>3.0kB</td><td>6.7kB</td><td>28.4kB</td><td>114.
|
|
195
|
+
<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>3.0kB</em> to your app. You can incrementally add the other modules as you need more functionality, or get it all for <em>6.0kB</em>. The <code>ui-react</code> adaptor is just another <em>2.6kB</em>, and everything is fast.</p><p>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>3.0kB</td><td>6.7kB</td><td>28.4kB</td><td>114.6kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/indexes">indexes</a></th><td>1.6kB</td><td>3.2kB</td><td>14.1kB</td><td>32.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/metrics">metrics</a></th><td>1.5kB</td><td>3.1kB</td><td>12.6kB</td><td>29.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/relationships">relationships</a></th><td>1.6kB</td><td>3.2kB</td><td>14.8kB</td><td>42.1kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/checkpoints">checkpoints</a></th><td>1.3kB</td><td>2.5kB</td><td>10.3kB</td><td>33.0kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/persisters">persisters</a></th><td>0.8kB</td><td>1.6kB</td><td>4.9kB</td><td>26.7kB</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"><a href="https://tinybase.org/api/tinybase">tinybase</a></th><td>6.0kB</td><td>14.2kB</td><td>60.0kB</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,004</td><td>1,004</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>1,094</td><td>1,094</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>417</td><td>417</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>363</td><td>363</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">1,795</td></tr><tr><th class="right">Assertions</th><td colspan="3">8,961</td></tr></tbody></table></div><hr><p><a id="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> and <a href="https://facebook.com/tinybasejs">Facebook</a>.</li><li><a href="https://tinybase.org/guides/releases/">Release notes</a> for each minor version.</li><li>Packages on <a href="https://www.npmjs.com/package/tinybase/v/1.3.5">NPM</a>.</li><li><a href="https://github.com/tinyplex/tinybase/issues">Issues</a> on <a href="https://github.com/tinyplex/tinybase">GitHub</a>.</li></ul></section><section><h2 id="about">About</h2><p>Building TinyBase was an interesting exercise in API design, minification, and documentation. It's not <a href="https://www.linkedin.com/in/jamespearce">my day job</a>, but I do intend to maintain it, so please provide feedback. I could not have done this 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>
|