tinybase 5.1.4 → 5.1.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.
Files changed (472) hide show
  1. package/@types/common/index.d.cts +34 -2
  2. package/@types/common/index.d.ts +34 -2
  3. package/@types/common/with-schemas/index.d.cts +34 -2
  4. package/@types/common/with-schemas/index.d.ts +34 -2
  5. package/@types/synchronizers/synchronizer-local/index.d.cts +1 -0
  6. package/@types/synchronizers/synchronizer-local/index.d.ts +1 -0
  7. package/@types/synchronizers/synchronizer-local/with-schemas/index.d.cts +1 -0
  8. package/@types/synchronizers/synchronizer-local/with-schemas/index.d.ts +1 -0
  9. package/checkpoints/index.js +9 -7
  10. package/checkpoints/with-schemas/index.js +9 -7
  11. package/cjs/checkpoints/index.cjs +9 -7
  12. package/cjs/checkpoints/with-schemas/index.cjs +9 -7
  13. package/cjs/es6/checkpoints/index.cjs +15 -13
  14. package/cjs/es6/checkpoints/with-schemas/index.cjs +15 -13
  15. package/cjs/es6/index.cjs +28 -20
  16. package/cjs/es6/indexes/index.cjs +15 -13
  17. package/cjs/es6/indexes/with-schemas/index.cjs +15 -13
  18. package/cjs/es6/mergeable-store/index.cjs +23 -17
  19. package/cjs/es6/mergeable-store/with-schemas/index.cjs +23 -17
  20. package/cjs/es6/metrics/index.cjs +15 -13
  21. package/cjs/es6/metrics/with-schemas/index.cjs +15 -13
  22. package/cjs/es6/min/index.cjs +1 -1
  23. package/cjs/es6/min/index.cjs.gz +0 -0
  24. package/cjs/es6/min/mergeable-store/index.cjs +1 -1
  25. package/cjs/es6/min/mergeable-store/index.cjs.gz +0 -0
  26. package/cjs/es6/min/mergeable-store/with-schemas/index.cjs +1 -1
  27. package/cjs/es6/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
  28. package/cjs/es6/min/store/index.cjs +1 -1
  29. package/cjs/es6/min/store/index.cjs.gz +0 -0
  30. package/cjs/es6/min/store/with-schemas/index.cjs +1 -1
  31. package/cjs/es6/min/store/with-schemas/index.cjs.gz +0 -0
  32. package/cjs/es6/min/ui-react-inspector/index.cjs +1 -1
  33. package/cjs/es6/min/ui-react-inspector/index.cjs.gz +0 -0
  34. package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs +1 -1
  35. package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
  36. package/cjs/es6/min/with-schemas/index.cjs +1 -1
  37. package/cjs/es6/min/with-schemas/index.cjs.gz +0 -0
  38. package/cjs/es6/persisters/index.cjs +5 -3
  39. package/cjs/es6/persisters/persister-automerge/index.cjs +5 -3
  40. package/cjs/es6/persisters/persister-automerge/with-schemas/index.cjs +5 -3
  41. package/cjs/es6/persisters/persister-browser/index.cjs +5 -3
  42. package/cjs/es6/persisters/persister-browser/with-schemas/index.cjs +5 -3
  43. package/cjs/es6/persisters/persister-cr-sqlite-wasm/index.cjs +8 -4
  44. package/cjs/es6/persisters/persister-cr-sqlite-wasm/with-schemas/index.cjs +8 -4
  45. package/cjs/es6/persisters/persister-electric-sql/index.cjs +8 -4
  46. package/cjs/es6/persisters/persister-electric-sql/with-schemas/index.cjs +8 -4
  47. package/cjs/es6/persisters/persister-expo-sqlite/index.cjs +8 -4
  48. package/cjs/es6/persisters/persister-expo-sqlite/with-schemas/index.cjs +8 -4
  49. package/cjs/es6/persisters/persister-file/index.cjs +5 -3
  50. package/cjs/es6/persisters/persister-file/with-schemas/index.cjs +5 -3
  51. package/cjs/es6/persisters/persister-indexed-db/index.cjs +5 -3
  52. package/cjs/es6/persisters/persister-indexed-db/with-schemas/index.cjs +5 -3
  53. package/cjs/es6/persisters/persister-libsql/index.cjs +8 -4
  54. package/cjs/es6/persisters/persister-libsql/with-schemas/index.cjs +8 -4
  55. package/cjs/es6/persisters/persister-partykit-client/index.cjs +5 -3
  56. package/cjs/es6/persisters/persister-partykit-client/with-schemas/index.cjs +5 -3
  57. package/cjs/es6/persisters/persister-partykit-server/index.cjs +36 -22
  58. package/cjs/es6/persisters/persister-partykit-server/with-schemas/index.cjs +36 -22
  59. package/cjs/es6/persisters/persister-powersync/index.cjs +8 -4
  60. package/cjs/es6/persisters/persister-powersync/with-schemas/index.cjs +8 -4
  61. package/cjs/es6/persisters/persister-remote/index.cjs +5 -3
  62. package/cjs/es6/persisters/persister-remote/with-schemas/index.cjs +5 -3
  63. package/cjs/es6/persisters/persister-sqlite-wasm/index.cjs +8 -4
  64. package/cjs/es6/persisters/persister-sqlite-wasm/with-schemas/index.cjs +8 -4
  65. package/cjs/es6/persisters/persister-sqlite3/index.cjs +8 -4
  66. package/cjs/es6/persisters/persister-sqlite3/with-schemas/index.cjs +8 -4
  67. package/cjs/es6/persisters/persister-yjs/index.cjs +5 -3
  68. package/cjs/es6/persisters/persister-yjs/with-schemas/index.cjs +5 -3
  69. package/cjs/es6/persisters/with-schemas/index.cjs +5 -3
  70. package/cjs/es6/relationships/index.cjs +15 -13
  71. package/cjs/es6/relationships/with-schemas/index.cjs +15 -13
  72. package/cjs/es6/store/index.cjs +23 -17
  73. package/cjs/es6/store/with-schemas/index.cjs +23 -17
  74. package/cjs/es6/synchronizers/index.cjs +5 -3
  75. package/cjs/es6/synchronizers/synchronizer-broadcast-channel/index.cjs +5 -3
  76. package/cjs/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +5 -3
  77. package/cjs/es6/synchronizers/synchronizer-local/index.cjs +5 -3
  78. package/cjs/es6/synchronizers/synchronizer-local/with-schemas/index.cjs +5 -3
  79. package/cjs/es6/synchronizers/synchronizer-ws-client/index.cjs +8 -6
  80. package/cjs/es6/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +8 -6
  81. package/cjs/es6/synchronizers/synchronizer-ws-server/index.cjs +39 -33
  82. package/cjs/es6/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +39 -33
  83. package/cjs/es6/synchronizers/with-schemas/index.cjs +5 -3
  84. package/cjs/es6/ui-react-inspector/index.cjs +30 -21
  85. package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +30 -21
  86. package/cjs/es6/with-schemas/index.cjs +28 -20
  87. package/cjs/index.cjs +22 -12
  88. package/cjs/indexes/index.cjs +9 -7
  89. package/cjs/indexes/with-schemas/index.cjs +9 -7
  90. package/cjs/mergeable-store/index.cjs +17 -9
  91. package/cjs/mergeable-store/with-schemas/index.cjs +17 -9
  92. package/cjs/metrics/index.cjs +9 -7
  93. package/cjs/metrics/with-schemas/index.cjs +9 -7
  94. package/cjs/min/index.cjs +1 -1
  95. package/cjs/min/index.cjs.gz +0 -0
  96. package/cjs/min/mergeable-store/index.cjs +1 -1
  97. package/cjs/min/mergeable-store/index.cjs.gz +0 -0
  98. package/cjs/min/mergeable-store/with-schemas/index.cjs +1 -1
  99. package/cjs/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
  100. package/cjs/min/store/index.cjs +1 -1
  101. package/cjs/min/store/index.cjs.gz +0 -0
  102. package/cjs/min/store/with-schemas/index.cjs +1 -1
  103. package/cjs/min/store/with-schemas/index.cjs.gz +0 -0
  104. package/cjs/min/tools/index.cjs +1 -1
  105. package/cjs/min/tools/index.cjs.gz +0 -0
  106. package/cjs/min/tools/with-schemas/index.cjs +1 -1
  107. package/cjs/min/tools/with-schemas/index.cjs.gz +0 -0
  108. package/cjs/min/ui-react-inspector/index.cjs +1 -1
  109. package/cjs/min/ui-react-inspector/index.cjs.gz +0 -0
  110. package/cjs/min/ui-react-inspector/with-schemas/index.cjs +1 -1
  111. package/cjs/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
  112. package/cjs/min/with-schemas/index.cjs +1 -1
  113. package/cjs/min/with-schemas/index.cjs.gz +0 -0
  114. package/cjs/persisters/index.cjs +5 -3
  115. package/cjs/persisters/persister-automerge/index.cjs +5 -3
  116. package/cjs/persisters/persister-automerge/with-schemas/index.cjs +5 -3
  117. package/cjs/persisters/persister-browser/index.cjs +5 -3
  118. package/cjs/persisters/persister-browser/with-schemas/index.cjs +5 -3
  119. package/cjs/persisters/persister-cr-sqlite-wasm/index.cjs +8 -4
  120. package/cjs/persisters/persister-cr-sqlite-wasm/with-schemas/index.cjs +8 -4
  121. package/cjs/persisters/persister-electric-sql/index.cjs +8 -4
  122. package/cjs/persisters/persister-electric-sql/with-schemas/index.cjs +8 -4
  123. package/cjs/persisters/persister-expo-sqlite/index.cjs +8 -4
  124. package/cjs/persisters/persister-expo-sqlite/with-schemas/index.cjs +8 -4
  125. package/cjs/persisters/persister-file/index.cjs +5 -3
  126. package/cjs/persisters/persister-file/with-schemas/index.cjs +5 -3
  127. package/cjs/persisters/persister-indexed-db/index.cjs +5 -3
  128. package/cjs/persisters/persister-indexed-db/with-schemas/index.cjs +5 -3
  129. package/cjs/persisters/persister-libsql/index.cjs +8 -4
  130. package/cjs/persisters/persister-libsql/with-schemas/index.cjs +8 -4
  131. package/cjs/persisters/persister-partykit-client/index.cjs +5 -3
  132. package/cjs/persisters/persister-partykit-client/with-schemas/index.cjs +5 -3
  133. package/cjs/persisters/persister-partykit-server/index.cjs +36 -25
  134. package/cjs/persisters/persister-partykit-server/with-schemas/index.cjs +36 -25
  135. package/cjs/persisters/persister-powersync/index.cjs +8 -4
  136. package/cjs/persisters/persister-powersync/with-schemas/index.cjs +8 -4
  137. package/cjs/persisters/persister-remote/index.cjs +5 -3
  138. package/cjs/persisters/persister-remote/with-schemas/index.cjs +5 -3
  139. package/cjs/persisters/persister-sqlite-wasm/index.cjs +8 -4
  140. package/cjs/persisters/persister-sqlite-wasm/with-schemas/index.cjs +8 -4
  141. package/cjs/persisters/persister-sqlite3/index.cjs +8 -4
  142. package/cjs/persisters/persister-sqlite3/with-schemas/index.cjs +8 -4
  143. package/cjs/persisters/persister-yjs/index.cjs +5 -3
  144. package/cjs/persisters/persister-yjs/with-schemas/index.cjs +5 -3
  145. package/cjs/persisters/with-schemas/index.cjs +5 -3
  146. package/cjs/relationships/index.cjs +9 -7
  147. package/cjs/relationships/with-schemas/index.cjs +9 -7
  148. package/cjs/store/index.cjs +17 -9
  149. package/cjs/store/with-schemas/index.cjs +17 -9
  150. package/cjs/synchronizers/index.cjs +5 -3
  151. package/cjs/synchronizers/synchronizer-broadcast-channel/index.cjs +5 -3
  152. package/cjs/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +5 -3
  153. package/cjs/synchronizers/synchronizer-local/index.cjs +5 -3
  154. package/cjs/synchronizers/synchronizer-local/with-schemas/index.cjs +5 -3
  155. package/cjs/synchronizers/synchronizer-ws-client/index.cjs +8 -6
  156. package/cjs/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +8 -6
  157. package/cjs/synchronizers/synchronizer-ws-server/index.cjs +28 -22
  158. package/cjs/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +28 -22
  159. package/cjs/synchronizers/with-schemas/index.cjs +5 -3
  160. package/cjs/tools/index.cjs +1 -1
  161. package/cjs/tools/with-schemas/index.cjs +1 -1
  162. package/cjs/ui-react-inspector/index.cjs +24 -13
  163. package/cjs/ui-react-inspector/with-schemas/index.cjs +24 -13
  164. package/cjs/with-schemas/index.cjs +22 -12
  165. package/es6/checkpoints/index.js +15 -13
  166. package/es6/checkpoints/with-schemas/index.js +15 -13
  167. package/es6/index.js +28 -20
  168. package/es6/indexes/index.js +15 -13
  169. package/es6/indexes/with-schemas/index.js +15 -13
  170. package/es6/mergeable-store/index.js +23 -17
  171. package/es6/mergeable-store/with-schemas/index.js +23 -17
  172. package/es6/metrics/index.js +15 -13
  173. package/es6/metrics/with-schemas/index.js +15 -13
  174. package/es6/min/index.js +1 -1
  175. package/es6/min/index.js.gz +0 -0
  176. package/es6/min/mergeable-store/index.js +1 -1
  177. package/es6/min/mergeable-store/index.js.gz +0 -0
  178. package/es6/min/mergeable-store/with-schemas/index.js +1 -1
  179. package/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
  180. package/es6/min/store/index.js +1 -1
  181. package/es6/min/store/index.js.gz +0 -0
  182. package/es6/min/store/with-schemas/index.js +1 -1
  183. package/es6/min/store/with-schemas/index.js.gz +0 -0
  184. package/es6/min/ui-react-inspector/index.js +1 -1
  185. package/es6/min/ui-react-inspector/index.js.gz +0 -0
  186. package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
  187. package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  188. package/es6/min/with-schemas/index.js +1 -1
  189. package/es6/min/with-schemas/index.js.gz +0 -0
  190. package/es6/persisters/index.js +5 -3
  191. package/es6/persisters/persister-automerge/index.js +5 -3
  192. package/es6/persisters/persister-automerge/with-schemas/index.js +5 -3
  193. package/es6/persisters/persister-browser/index.js +5 -3
  194. package/es6/persisters/persister-browser/with-schemas/index.js +5 -3
  195. package/es6/persisters/persister-cr-sqlite-wasm/index.js +8 -4
  196. package/es6/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +8 -4
  197. package/es6/persisters/persister-electric-sql/index.js +8 -4
  198. package/es6/persisters/persister-electric-sql/with-schemas/index.js +8 -4
  199. package/es6/persisters/persister-expo-sqlite/index.js +8 -4
  200. package/es6/persisters/persister-expo-sqlite/with-schemas/index.js +8 -4
  201. package/es6/persisters/persister-file/index.js +5 -3
  202. package/es6/persisters/persister-file/with-schemas/index.js +5 -3
  203. package/es6/persisters/persister-indexed-db/index.js +5 -3
  204. package/es6/persisters/persister-indexed-db/with-schemas/index.js +5 -3
  205. package/es6/persisters/persister-libsql/index.js +8 -4
  206. package/es6/persisters/persister-libsql/with-schemas/index.js +8 -4
  207. package/es6/persisters/persister-partykit-client/index.js +5 -3
  208. package/es6/persisters/persister-partykit-client/with-schemas/index.js +5 -3
  209. package/es6/persisters/persister-partykit-server/index.js +36 -22
  210. package/es6/persisters/persister-partykit-server/with-schemas/index.js +36 -22
  211. package/es6/persisters/persister-powersync/index.js +8 -4
  212. package/es6/persisters/persister-powersync/with-schemas/index.js +8 -4
  213. package/es6/persisters/persister-remote/index.js +5 -3
  214. package/es6/persisters/persister-remote/with-schemas/index.js +5 -3
  215. package/es6/persisters/persister-sqlite-wasm/index.js +8 -4
  216. package/es6/persisters/persister-sqlite-wasm/with-schemas/index.js +8 -4
  217. package/es6/persisters/persister-sqlite3/index.js +8 -4
  218. package/es6/persisters/persister-sqlite3/with-schemas/index.js +8 -4
  219. package/es6/persisters/persister-yjs/index.js +5 -3
  220. package/es6/persisters/persister-yjs/with-schemas/index.js +5 -3
  221. package/es6/persisters/with-schemas/index.js +5 -3
  222. package/es6/relationships/index.js +15 -13
  223. package/es6/relationships/with-schemas/index.js +15 -13
  224. package/es6/store/index.js +23 -17
  225. package/es6/store/with-schemas/index.js +23 -17
  226. package/es6/synchronizers/index.js +5 -3
  227. package/es6/synchronizers/synchronizer-broadcast-channel/index.js +5 -3
  228. package/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -3
  229. package/es6/synchronizers/synchronizer-local/index.js +5 -3
  230. package/es6/synchronizers/synchronizer-local/with-schemas/index.js +5 -3
  231. package/es6/synchronizers/synchronizer-ws-client/index.js +8 -6
  232. package/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +8 -6
  233. package/es6/synchronizers/synchronizer-ws-server/index.js +39 -33
  234. package/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +39 -33
  235. package/es6/synchronizers/with-schemas/index.js +5 -3
  236. package/es6/ui-react-inspector/index.js +30 -21
  237. package/es6/ui-react-inspector/with-schemas/index.js +30 -21
  238. package/es6/with-schemas/index.js +28 -20
  239. package/index.js +22 -12
  240. package/indexes/index.js +9 -7
  241. package/indexes/with-schemas/index.js +9 -7
  242. package/mergeable-store/index.js +17 -9
  243. package/mergeable-store/with-schemas/index.js +17 -9
  244. package/metrics/index.js +9 -7
  245. package/metrics/with-schemas/index.js +9 -7
  246. package/min/index.js +1 -1
  247. package/min/index.js.gz +0 -0
  248. package/min/mergeable-store/index.js +1 -1
  249. package/min/mergeable-store/index.js.gz +0 -0
  250. package/min/mergeable-store/with-schemas/index.js +1 -1
  251. package/min/mergeable-store/with-schemas/index.js.gz +0 -0
  252. package/min/store/index.js +1 -1
  253. package/min/store/index.js.gz +0 -0
  254. package/min/store/with-schemas/index.js +1 -1
  255. package/min/store/with-schemas/index.js.gz +0 -0
  256. package/min/tools/index.js +1 -1
  257. package/min/tools/index.js.gz +0 -0
  258. package/min/tools/with-schemas/index.js +1 -1
  259. package/min/tools/with-schemas/index.js.gz +0 -0
  260. package/min/ui-react-inspector/index.js +1 -1
  261. package/min/ui-react-inspector/index.js.gz +0 -0
  262. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  263. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  264. package/min/with-schemas/index.js +1 -1
  265. package/min/with-schemas/index.js.gz +0 -0
  266. package/package.json +2 -2
  267. package/persisters/index.js +5 -3
  268. package/persisters/persister-automerge/index.js +5 -3
  269. package/persisters/persister-automerge/with-schemas/index.js +5 -3
  270. package/persisters/persister-browser/index.js +5 -3
  271. package/persisters/persister-browser/with-schemas/index.js +5 -3
  272. package/persisters/persister-cr-sqlite-wasm/index.js +8 -4
  273. package/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +8 -4
  274. package/persisters/persister-electric-sql/index.js +8 -4
  275. package/persisters/persister-electric-sql/with-schemas/index.js +8 -4
  276. package/persisters/persister-expo-sqlite/index.js +8 -4
  277. package/persisters/persister-expo-sqlite/with-schemas/index.js +8 -4
  278. package/persisters/persister-file/index.js +5 -3
  279. package/persisters/persister-file/with-schemas/index.js +5 -3
  280. package/persisters/persister-indexed-db/index.js +5 -3
  281. package/persisters/persister-indexed-db/with-schemas/index.js +5 -3
  282. package/persisters/persister-libsql/index.js +8 -4
  283. package/persisters/persister-libsql/with-schemas/index.js +8 -4
  284. package/persisters/persister-partykit-client/index.js +5 -3
  285. package/persisters/persister-partykit-client/with-schemas/index.js +5 -3
  286. package/persisters/persister-partykit-server/index.js +36 -25
  287. package/persisters/persister-partykit-server/with-schemas/index.js +36 -25
  288. package/persisters/persister-powersync/index.js +8 -4
  289. package/persisters/persister-powersync/with-schemas/index.js +8 -4
  290. package/persisters/persister-remote/index.js +5 -3
  291. package/persisters/persister-remote/with-schemas/index.js +5 -3
  292. package/persisters/persister-sqlite-wasm/index.js +8 -4
  293. package/persisters/persister-sqlite-wasm/with-schemas/index.js +8 -4
  294. package/persisters/persister-sqlite3/index.js +8 -4
  295. package/persisters/persister-sqlite3/with-schemas/index.js +8 -4
  296. package/persisters/persister-yjs/index.js +5 -3
  297. package/persisters/persister-yjs/with-schemas/index.js +5 -3
  298. package/persisters/with-schemas/index.js +5 -3
  299. package/readme.md +2 -2
  300. package/relationships/index.js +9 -7
  301. package/relationships/with-schemas/index.js +9 -7
  302. package/store/index.js +17 -9
  303. package/store/with-schemas/index.js +17 -9
  304. package/synchronizers/index.js +5 -3
  305. package/synchronizers/synchronizer-broadcast-channel/index.js +5 -3
  306. package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -3
  307. package/synchronizers/synchronizer-local/index.js +5 -3
  308. package/synchronizers/synchronizer-local/with-schemas/index.js +5 -3
  309. package/synchronizers/synchronizer-ws-client/index.js +8 -6
  310. package/synchronizers/synchronizer-ws-client/with-schemas/index.js +8 -6
  311. package/synchronizers/synchronizer-ws-server/index.js +28 -22
  312. package/synchronizers/synchronizer-ws-server/with-schemas/index.js +28 -22
  313. package/synchronizers/with-schemas/index.js +5 -3
  314. package/tools/index.js +1 -1
  315. package/tools/with-schemas/index.js +1 -1
  316. package/ui-react-inspector/index.js +24 -13
  317. package/ui-react-inspector/with-schemas/index.js +24 -13
  318. package/umd/checkpoints/index.js +9 -7
  319. package/umd/checkpoints/with-schemas/index.js +9 -7
  320. package/umd/es6/checkpoints/index.js +15 -13
  321. package/umd/es6/checkpoints/with-schemas/index.js +15 -13
  322. package/umd/es6/index.js +28 -20
  323. package/umd/es6/indexes/index.js +15 -13
  324. package/umd/es6/indexes/with-schemas/index.js +15 -13
  325. package/umd/es6/mergeable-store/index.js +23 -17
  326. package/umd/es6/mergeable-store/with-schemas/index.js +23 -17
  327. package/umd/es6/metrics/index.js +15 -13
  328. package/umd/es6/metrics/with-schemas/index.js +15 -13
  329. package/umd/es6/min/index.js +1 -1
  330. package/umd/es6/min/index.js.gz +0 -0
  331. package/umd/es6/min/mergeable-store/index.js +1 -1
  332. package/umd/es6/min/mergeable-store/index.js.gz +0 -0
  333. package/umd/es6/min/mergeable-store/with-schemas/index.js +1 -1
  334. package/umd/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
  335. package/umd/es6/min/store/index.js +1 -1
  336. package/umd/es6/min/store/index.js.gz +0 -0
  337. package/umd/es6/min/store/with-schemas/index.js +1 -1
  338. package/umd/es6/min/store/with-schemas/index.js.gz +0 -0
  339. package/umd/es6/min/ui-react-inspector/index.js +1 -1
  340. package/umd/es6/min/ui-react-inspector/index.js.gz +0 -0
  341. package/umd/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
  342. package/umd/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  343. package/umd/es6/min/with-schemas/index.js +1 -1
  344. package/umd/es6/min/with-schemas/index.js.gz +0 -0
  345. package/umd/es6/persisters/index.js +5 -3
  346. package/umd/es6/persisters/persister-automerge/index.js +5 -3
  347. package/umd/es6/persisters/persister-automerge/with-schemas/index.js +5 -3
  348. package/umd/es6/persisters/persister-browser/index.js +5 -3
  349. package/umd/es6/persisters/persister-browser/with-schemas/index.js +5 -3
  350. package/umd/es6/persisters/persister-cr-sqlite-wasm/index.js +8 -4
  351. package/umd/es6/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +8 -4
  352. package/umd/es6/persisters/persister-electric-sql/index.js +8 -4
  353. package/umd/es6/persisters/persister-electric-sql/with-schemas/index.js +8 -4
  354. package/umd/es6/persisters/persister-expo-sqlite/index.js +8 -4
  355. package/umd/es6/persisters/persister-expo-sqlite/with-schemas/index.js +8 -4
  356. package/umd/es6/persisters/persister-file/index.js +5 -3
  357. package/umd/es6/persisters/persister-file/with-schemas/index.js +5 -3
  358. package/umd/es6/persisters/persister-indexed-db/index.js +5 -3
  359. package/umd/es6/persisters/persister-indexed-db/with-schemas/index.js +5 -3
  360. package/umd/es6/persisters/persister-libsql/index.js +8 -4
  361. package/umd/es6/persisters/persister-libsql/with-schemas/index.js +8 -4
  362. package/umd/es6/persisters/persister-partykit-client/index.js +5 -3
  363. package/umd/es6/persisters/persister-partykit-client/with-schemas/index.js +5 -3
  364. package/umd/es6/persisters/persister-partykit-server/index.js +36 -22
  365. package/umd/es6/persisters/persister-partykit-server/with-schemas/index.js +36 -22
  366. package/umd/es6/persisters/persister-powersync/index.js +8 -4
  367. package/umd/es6/persisters/persister-powersync/with-schemas/index.js +8 -4
  368. package/umd/es6/persisters/persister-remote/index.js +5 -3
  369. package/umd/es6/persisters/persister-remote/with-schemas/index.js +5 -3
  370. package/umd/es6/persisters/persister-sqlite-wasm/index.js +8 -4
  371. package/umd/es6/persisters/persister-sqlite-wasm/with-schemas/index.js +8 -4
  372. package/umd/es6/persisters/persister-sqlite3/index.js +8 -4
  373. package/umd/es6/persisters/persister-sqlite3/with-schemas/index.js +8 -4
  374. package/umd/es6/persisters/persister-yjs/index.js +5 -3
  375. package/umd/es6/persisters/persister-yjs/with-schemas/index.js +5 -3
  376. package/umd/es6/persisters/with-schemas/index.js +5 -3
  377. package/umd/es6/relationships/index.js +15 -13
  378. package/umd/es6/relationships/with-schemas/index.js +15 -13
  379. package/umd/es6/store/index.js +23 -17
  380. package/umd/es6/store/with-schemas/index.js +23 -17
  381. package/umd/es6/synchronizers/index.js +5 -3
  382. package/umd/es6/synchronizers/synchronizer-broadcast-channel/index.js +5 -3
  383. package/umd/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -3
  384. package/umd/es6/synchronizers/synchronizer-local/index.js +5 -3
  385. package/umd/es6/synchronizers/synchronizer-local/with-schemas/index.js +5 -3
  386. package/umd/es6/synchronizers/synchronizer-ws-client/index.js +8 -6
  387. package/umd/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +8 -6
  388. package/umd/es6/synchronizers/synchronizer-ws-server/index.js +39 -33
  389. package/umd/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +39 -33
  390. package/umd/es6/synchronizers/with-schemas/index.js +5 -3
  391. package/umd/es6/ui-react-inspector/index.js +30 -21
  392. package/umd/es6/ui-react-inspector/with-schemas/index.js +30 -21
  393. package/umd/es6/with-schemas/index.js +28 -20
  394. package/umd/index.js +22 -12
  395. package/umd/indexes/index.js +9 -7
  396. package/umd/indexes/with-schemas/index.js +9 -7
  397. package/umd/mergeable-store/index.js +17 -9
  398. package/umd/mergeable-store/with-schemas/index.js +17 -9
  399. package/umd/metrics/index.js +9 -7
  400. package/umd/metrics/with-schemas/index.js +9 -7
  401. package/umd/min/index.js +1 -1
  402. package/umd/min/index.js.gz +0 -0
  403. package/umd/min/mergeable-store/index.js +1 -1
  404. package/umd/min/mergeable-store/index.js.gz +0 -0
  405. package/umd/min/mergeable-store/with-schemas/index.js +1 -1
  406. package/umd/min/mergeable-store/with-schemas/index.js.gz +0 -0
  407. package/umd/min/store/index.js +1 -1
  408. package/umd/min/store/index.js.gz +0 -0
  409. package/umd/min/store/with-schemas/index.js +1 -1
  410. package/umd/min/store/with-schemas/index.js.gz +0 -0
  411. package/umd/min/tools/index.js +1 -1
  412. package/umd/min/tools/index.js.gz +0 -0
  413. package/umd/min/tools/with-schemas/index.js +1 -1
  414. package/umd/min/tools/with-schemas/index.js.gz +0 -0
  415. package/umd/min/ui-react-inspector/index.js +1 -1
  416. package/umd/min/ui-react-inspector/index.js.gz +0 -0
  417. package/umd/min/ui-react-inspector/with-schemas/index.js +1 -1
  418. package/umd/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  419. package/umd/min/with-schemas/index.js +1 -1
  420. package/umd/min/with-schemas/index.js.gz +0 -0
  421. package/umd/persisters/index.js +5 -3
  422. package/umd/persisters/persister-automerge/index.js +5 -3
  423. package/umd/persisters/persister-automerge/with-schemas/index.js +5 -3
  424. package/umd/persisters/persister-browser/index.js +5 -3
  425. package/umd/persisters/persister-browser/with-schemas/index.js +5 -3
  426. package/umd/persisters/persister-cr-sqlite-wasm/index.js +8 -4
  427. package/umd/persisters/persister-cr-sqlite-wasm/with-schemas/index.js +8 -4
  428. package/umd/persisters/persister-electric-sql/index.js +8 -4
  429. package/umd/persisters/persister-electric-sql/with-schemas/index.js +8 -4
  430. package/umd/persisters/persister-expo-sqlite/index.js +8 -4
  431. package/umd/persisters/persister-expo-sqlite/with-schemas/index.js +8 -4
  432. package/umd/persisters/persister-file/index.js +5 -3
  433. package/umd/persisters/persister-file/with-schemas/index.js +5 -3
  434. package/umd/persisters/persister-indexed-db/index.js +5 -3
  435. package/umd/persisters/persister-indexed-db/with-schemas/index.js +5 -3
  436. package/umd/persisters/persister-libsql/index.js +8 -4
  437. package/umd/persisters/persister-libsql/with-schemas/index.js +8 -4
  438. package/umd/persisters/persister-partykit-client/index.js +5 -3
  439. package/umd/persisters/persister-partykit-client/with-schemas/index.js +5 -3
  440. package/umd/persisters/persister-partykit-server/index.js +36 -25
  441. package/umd/persisters/persister-partykit-server/with-schemas/index.js +36 -25
  442. package/umd/persisters/persister-powersync/index.js +8 -4
  443. package/umd/persisters/persister-powersync/with-schemas/index.js +8 -4
  444. package/umd/persisters/persister-remote/index.js +5 -3
  445. package/umd/persisters/persister-remote/with-schemas/index.js +5 -3
  446. package/umd/persisters/persister-sqlite-wasm/index.js +8 -4
  447. package/umd/persisters/persister-sqlite-wasm/with-schemas/index.js +8 -4
  448. package/umd/persisters/persister-sqlite3/index.js +8 -4
  449. package/umd/persisters/persister-sqlite3/with-schemas/index.js +8 -4
  450. package/umd/persisters/persister-yjs/index.js +5 -3
  451. package/umd/persisters/persister-yjs/with-schemas/index.js +5 -3
  452. package/umd/persisters/with-schemas/index.js +5 -3
  453. package/umd/relationships/index.js +9 -7
  454. package/umd/relationships/with-schemas/index.js +9 -7
  455. package/umd/store/index.js +17 -9
  456. package/umd/store/with-schemas/index.js +17 -9
  457. package/umd/synchronizers/index.js +5 -3
  458. package/umd/synchronizers/synchronizer-broadcast-channel/index.js +5 -3
  459. package/umd/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -3
  460. package/umd/synchronizers/synchronizer-local/index.js +5 -3
  461. package/umd/synchronizers/synchronizer-local/with-schemas/index.js +5 -3
  462. package/umd/synchronizers/synchronizer-ws-client/index.js +8 -6
  463. package/umd/synchronizers/synchronizer-ws-client/with-schemas/index.js +8 -6
  464. package/umd/synchronizers/synchronizer-ws-server/index.js +28 -22
  465. package/umd/synchronizers/synchronizer-ws-server/with-schemas/index.js +28 -22
  466. package/umd/synchronizers/with-schemas/index.js +5 -3
  467. package/umd/tools/index.js +1 -1
  468. package/umd/tools/with-schemas/index.js +1 -1
  469. package/umd/ui-react-inspector/index.js +24 -13
  470. package/umd/ui-react-inspector/with-schemas/index.js +24 -13
  471. package/umd/with-schemas/index.js +22 -12
  472. package/with-schemas/index.js +22 -12
@@ -127,20 +127,24 @@ const saveStore = async (that, changes, initialSave, requestOrConnection) => {
127
127
  objToArray(row, async (cell, cellId) => {
128
128
  const ids = [tableId, rowId, cellId];
129
129
  const key = constructStorageKey(storagePrefix, T, ...ids);
130
- isUndefined(cell)
131
- ? !initialSave &&
132
- (await that.canDelCell(
133
- ...ids,
134
- requestOrConnection,
135
- )) &&
136
- arrayPush(keysToDel, key)
137
- : (await that.canSetCell(
138
- ...ids,
139
- cell,
140
- initialSave,
141
- requestOrConnection,
142
- await storage.get(key),
143
- )) && (keysToSet[key] = cell);
130
+ if (isUndefined(cell)) {
131
+ if (
132
+ !initialSave &&
133
+ (await that.canDelCell(...ids, requestOrConnection))
134
+ ) {
135
+ arrayPush(keysToDel, key);
136
+ }
137
+ } else if (
138
+ await that.canSetCell(
139
+ ...ids,
140
+ cell,
141
+ initialSave,
142
+ requestOrConnection,
143
+ await storage.get(key),
144
+ )
145
+ ) {
146
+ keysToSet[key] = cell;
147
+ }
144
148
  }),
145
149
  )),
146
150
  ),
@@ -150,17 +154,24 @@ const saveStore = async (that, changes, initialSave, requestOrConnection) => {
150
154
  await promiseAll(
151
155
  objToArray(changes[1], async (value, valueId) => {
152
156
  const key = storagePrefix + V + valueId;
153
- isUndefined(value)
154
- ? !initialSave &&
155
- (await that.canDelValue(valueId, requestOrConnection)) &&
156
- arrayPush(keysToDel, key)
157
- : (await that.canSetValue(
158
- valueId,
159
- value,
160
- initialSave,
161
- requestOrConnection,
162
- await storage.get(key),
163
- )) && (keysToSet[key] = value);
157
+ if (isUndefined(value)) {
158
+ if (
159
+ !initialSave &&
160
+ (await that.canDelValue(valueId, requestOrConnection))
161
+ ) {
162
+ arrayPush(keysToDel, key);
163
+ }
164
+ } else if (
165
+ await that.canSetValue(
166
+ valueId,
167
+ value,
168
+ initialSave,
169
+ requestOrConnection,
170
+ await storage.get(key),
171
+ )
172
+ ) {
173
+ keysToSet[key] = value;
174
+ }
164
175
  }),
165
176
  );
166
177
  if (!arrayIsEmpty(keyPrefixesToDel)) {
@@ -127,20 +127,24 @@ const saveStore = async (that, changes, initialSave, requestOrConnection) => {
127
127
  objToArray(row, async (cell, cellId) => {
128
128
  const ids = [tableId, rowId, cellId];
129
129
  const key = constructStorageKey(storagePrefix, T, ...ids);
130
- isUndefined(cell)
131
- ? !initialSave &&
132
- (await that.canDelCell(
133
- ...ids,
134
- requestOrConnection,
135
- )) &&
136
- arrayPush(keysToDel, key)
137
- : (await that.canSetCell(
138
- ...ids,
139
- cell,
140
- initialSave,
141
- requestOrConnection,
142
- await storage.get(key),
143
- )) && (keysToSet[key] = cell);
130
+ if (isUndefined(cell)) {
131
+ if (
132
+ !initialSave &&
133
+ (await that.canDelCell(...ids, requestOrConnection))
134
+ ) {
135
+ arrayPush(keysToDel, key);
136
+ }
137
+ } else if (
138
+ await that.canSetCell(
139
+ ...ids,
140
+ cell,
141
+ initialSave,
142
+ requestOrConnection,
143
+ await storage.get(key),
144
+ )
145
+ ) {
146
+ keysToSet[key] = cell;
147
+ }
144
148
  }),
145
149
  )),
146
150
  ),
@@ -150,17 +154,24 @@ const saveStore = async (that, changes, initialSave, requestOrConnection) => {
150
154
  await promiseAll(
151
155
  objToArray(changes[1], async (value, valueId) => {
152
156
  const key = storagePrefix + V + valueId;
153
- isUndefined(value)
154
- ? !initialSave &&
155
- (await that.canDelValue(valueId, requestOrConnection)) &&
156
- arrayPush(keysToDel, key)
157
- : (await that.canSetValue(
158
- valueId,
159
- value,
160
- initialSave,
161
- requestOrConnection,
162
- await storage.get(key),
163
- )) && (keysToSet[key] = value);
157
+ if (isUndefined(value)) {
158
+ if (
159
+ !initialSave &&
160
+ (await that.canDelValue(valueId, requestOrConnection))
161
+ ) {
162
+ arrayPush(keysToDel, key);
163
+ }
164
+ } else if (
165
+ await that.canSetValue(
166
+ valueId,
167
+ value,
168
+ initialSave,
169
+ requestOrConnection,
170
+ await storage.get(key),
171
+ )
172
+ ) {
173
+ keysToSet[key] = value;
174
+ }
164
175
  }),
165
176
  );
166
177
  if (!arrayIsEmpty(keyPrefixesToDel)) {
@@ -8,7 +8,9 @@ const strRepeat = (str, count) => str.repeat(count);
8
8
 
9
9
  const promise = Promise;
10
10
  const startInterval = (callback, sec, immediate) => {
11
- callback();
11
+ {
12
+ callback();
13
+ }
12
14
  return setInterval(callback, sec * 1e3);
13
15
  };
14
16
  const stopInterval = clearInterval;
@@ -470,9 +472,11 @@ const createCustomPersister = (
470
472
  await schedule(async () => {
471
473
  try {
472
474
  const content = await getPersisted();
473
- isArray(content)
474
- ? setContentOrChanges(content)
475
- : errorNew(`Content is not an array ${content}`);
475
+ if (isArray(content)) {
476
+ setContentOrChanges(content);
477
+ } else {
478
+ errorNew(`Content is not an array ${content}`);
479
+ }
476
480
  } catch (error) {
477
481
  onIgnoredError?.(error);
478
482
  if (initialContent) {
@@ -8,7 +8,9 @@ const strRepeat = (str, count) => str.repeat(count);
8
8
 
9
9
  const promise = Promise;
10
10
  const startInterval = (callback, sec, immediate) => {
11
- callback();
11
+ {
12
+ callback();
13
+ }
12
14
  return setInterval(callback, sec * 1e3);
13
15
  };
14
16
  const stopInterval = clearInterval;
@@ -470,9 +472,11 @@ const createCustomPersister = (
470
472
  await schedule(async () => {
471
473
  try {
472
474
  const content = await getPersisted();
473
- isArray(content)
474
- ? setContentOrChanges(content)
475
- : errorNew(`Content is not an array ${content}`);
475
+ if (isArray(content)) {
476
+ setContentOrChanges(content);
477
+ } else {
478
+ errorNew(`Content is not an array ${content}`);
479
+ }
476
480
  } catch (error) {
477
481
  onIgnoredError?.(error);
478
482
  if (initialContent) {
@@ -136,9 +136,11 @@ const createCustomPersister = (
136
136
  await schedule(async () => {
137
137
  try {
138
138
  const content = await getPersisted();
139
- isArray(content)
140
- ? setContentOrChanges(content)
141
- : errorNew(`Content is not an array ${content}`);
139
+ if (isArray(content)) {
140
+ setContentOrChanges(content);
141
+ } else {
142
+ errorNew(`Content is not an array ${content}`);
143
+ }
142
144
  } catch (error) {
143
145
  onIgnoredError?.(error);
144
146
  if (initialContent) {
@@ -136,9 +136,11 @@ const createCustomPersister = (
136
136
  await schedule(async () => {
137
137
  try {
138
138
  const content = await getPersisted();
139
- isArray(content)
140
- ? setContentOrChanges(content)
141
- : errorNew(`Content is not an array ${content}`);
139
+ if (isArray(content)) {
140
+ setContentOrChanges(content);
141
+ } else {
142
+ errorNew(`Content is not an array ${content}`);
143
+ }
142
144
  } catch (error) {
143
145
  onIgnoredError?.(error);
144
146
  if (initialContent) {
@@ -8,7 +8,9 @@ const strRepeat = (str, count) => str.repeat(count);
8
8
 
9
9
  const promise = Promise;
10
10
  const startInterval = (callback, sec, immediate) => {
11
- callback();
11
+ {
12
+ callback();
13
+ }
12
14
  return setInterval(callback, sec * 1e3);
13
15
  };
14
16
  const stopInterval = clearInterval;
@@ -470,9 +472,11 @@ const createCustomPersister = (
470
472
  await schedule(async () => {
471
473
  try {
472
474
  const content = await getPersisted();
473
- isArray(content)
474
- ? setContentOrChanges(content)
475
- : errorNew(`Content is not an array ${content}`);
475
+ if (isArray(content)) {
476
+ setContentOrChanges(content);
477
+ } else {
478
+ errorNew(`Content is not an array ${content}`);
479
+ }
476
480
  } catch (error) {
477
481
  onIgnoredError?.(error);
478
482
  if (initialContent) {
@@ -8,7 +8,9 @@ const strRepeat = (str, count) => str.repeat(count);
8
8
 
9
9
  const promise = Promise;
10
10
  const startInterval = (callback, sec, immediate) => {
11
- callback();
11
+ {
12
+ callback();
13
+ }
12
14
  return setInterval(callback, sec * 1e3);
13
15
  };
14
16
  const stopInterval = clearInterval;
@@ -470,9 +472,11 @@ const createCustomPersister = (
470
472
  await schedule(async () => {
471
473
  try {
472
474
  const content = await getPersisted();
473
- isArray(content)
474
- ? setContentOrChanges(content)
475
- : errorNew(`Content is not an array ${content}`);
475
+ if (isArray(content)) {
476
+ setContentOrChanges(content);
477
+ } else {
478
+ errorNew(`Content is not an array ${content}`);
479
+ }
476
480
  } catch (error) {
477
481
  onIgnoredError?.(error);
478
482
  if (initialContent) {
@@ -8,7 +8,9 @@ const strRepeat = (str, count) => str.repeat(count);
8
8
 
9
9
  const promise = Promise;
10
10
  const startInterval = (callback, sec, immediate) => {
11
- callback();
11
+ {
12
+ callback();
13
+ }
12
14
  return setInterval(callback, sec * 1e3);
13
15
  };
14
16
  const stopInterval = clearInterval;
@@ -471,9 +473,11 @@ const createCustomPersister = (
471
473
  await schedule(async () => {
472
474
  try {
473
475
  const content = await getPersisted();
474
- isArray(content)
475
- ? setContentOrChanges(content)
476
- : errorNew(`Content is not an array ${content}`);
476
+ if (isArray(content)) {
477
+ setContentOrChanges(content);
478
+ } else {
479
+ errorNew(`Content is not an array ${content}`);
480
+ }
477
481
  } catch (error) {
478
482
  onIgnoredError?.(error);
479
483
  if (initialContent) {
@@ -8,7 +8,9 @@ const strRepeat = (str, count) => str.repeat(count);
8
8
 
9
9
  const promise = Promise;
10
10
  const startInterval = (callback, sec, immediate) => {
11
- callback();
11
+ {
12
+ callback();
13
+ }
12
14
  return setInterval(callback, sec * 1e3);
13
15
  };
14
16
  const stopInterval = clearInterval;
@@ -471,9 +473,11 @@ const createCustomPersister = (
471
473
  await schedule(async () => {
472
474
  try {
473
475
  const content = await getPersisted();
474
- isArray(content)
475
- ? setContentOrChanges(content)
476
- : errorNew(`Content is not an array ${content}`);
476
+ if (isArray(content)) {
477
+ setContentOrChanges(content);
478
+ } else {
479
+ errorNew(`Content is not an array ${content}`);
480
+ }
477
481
  } catch (error) {
478
482
  onIgnoredError?.(error);
479
483
  if (initialContent) {
@@ -148,9 +148,11 @@ const createCustomPersister = (
148
148
  await schedule(async () => {
149
149
  try {
150
150
  const content = await getPersisted();
151
- isArray(content)
152
- ? setContentOrChanges(content)
153
- : errorNew(`Content is not an array ${content}`);
151
+ if (isArray(content)) {
152
+ setContentOrChanges(content);
153
+ } else {
154
+ errorNew(`Content is not an array ${content}`);
155
+ }
154
156
  } catch (error) {
155
157
  onIgnoredError?.(error);
156
158
  if (initialContent) {
@@ -148,9 +148,11 @@ const createCustomPersister = (
148
148
  await schedule(async () => {
149
149
  try {
150
150
  const content = await getPersisted();
151
- isArray(content)
152
- ? setContentOrChanges(content)
153
- : errorNew(`Content is not an array ${content}`);
151
+ if (isArray(content)) {
152
+ setContentOrChanges(content);
153
+ } else {
154
+ errorNew(`Content is not an array ${content}`);
155
+ }
154
156
  } catch (error) {
155
157
  onIgnoredError?.(error);
156
158
  if (initialContent) {
@@ -130,9 +130,11 @@ const createCustomPersister = (
130
130
  await schedule(async () => {
131
131
  try {
132
132
  const content = await getPersisted();
133
- isArray(content)
134
- ? setContentOrChanges(content)
135
- : errorNew(`Content is not an array ${content}`);
133
+ if (isArray(content)) {
134
+ setContentOrChanges(content);
135
+ } else {
136
+ errorNew(`Content is not an array ${content}`);
137
+ }
136
138
  } catch (error) {
137
139
  onIgnoredError?.(error);
138
140
  if (initialContent) {
package/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- <section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2></section><p><a href="https://tinybase.org/guides/releases/#v5-1"><em>NEW!</em> v5.1 release</a></p><p><span id="one-with">&quot;The One You Can Sync... with a server!&quot;</span></p><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="it-s-reactive">It&#x27;s <em>Reactive</em></h2><p>TinyBase lets you <a href="#register-granular-listeners">listen to changes</a> made to any part of your data. This means your app will be fast, since you only spend rendering cycles on things that change. The optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and <a href="#pre-built-reactive-components">pre-built components</a> let you easily build fully reactive UIs on top of TinyBase. You even get a built-in <a href="#set-checkpoints-for-an-undo-stack">undo stack</a>, and <a href="#an-inspector-for-your-data">developer tools</a>!</p></section><section><h2 id="it-s-database-like">It&#x27;s <em>Database-Like</em></h2><p>Consumer app? Enterprise app? Or even a game? Model <a href="#start-with-a-simple-key-value-store">key-value data</a> and <a href="#level-up-to-use-tabular-data">tabular data</a> with optional typed <a href="#apply-schemas-to-tables-values">schematization</a>, whatever its data structures. There are built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, and tabular <a href="#model-table-relationships">relationships</a> APIs - and a powerful <a href="#build-complex-queries-with-tinyql">query engine</a> to select, join, filter, and group data (reactively!) without SQL.</p></section><section><h2 id="it-synchronizes">It <em>Synchronizes</em></h2><p>TinyBase has <a href="#synchronize-between-devices">native CRDT</a> support, meaning that you can deterministically <a href="https://tinybase.org/guides/synchronization/">synchronize</a> and merge data across multiple sources, clients, and servers. And although TinyBase is an in-memory data store, but you can easily <a href="#persist-to-storage-sqlite-more">persist</a> your data to file, <a href="https://tinybase.org/api/persister-browser">browser storage</a>, <a href="https://tinybase.org/api/persister-indexed-db">IndexedDB</a>, <a href="https://tinybase.org/guides/persistence/database-persistence/">SQLite databases</a>, and <a href="https://tinybase.org/guides/persistence/third-party-crdt-persistence/">more</a>.</p></section><section><h2 id="it-s-built-for-a-local-first-world">It&#x27;s Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it&#x27;s especially great for local-first apps: where data is stored locally on the user&#x27;s device and that can be run offline. It&#x27;s tiny by name, tiny by nature: just <a href="#did-we-say-tiny">5.3kB - 12.7kB</a> and with no dependencies - yet <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</p></section><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends!</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/turso.svg">Turso</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/powersync.svg">PowerSync</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;label=Twitter&amp;labelColor=%23333&amp;color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/5.1.3" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
1
+ <section id="hero"><h2 id="the-reactive-data-store-for-local-first-apps">The <em>reactive</em> data store for <span>local-first apps</span>.</h2></section><p><a href="https://tinybase.org/guides/releases/#v5-1"><em>NEW!</em> v5.1 release</a></p><p><span id="one-with">&quot;The One You Can Sync... with a server!&quot;</span></p><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="it-s-reactive">It&#x27;s <em>Reactive</em></h2><p>TinyBase lets you <a href="#register-granular-listeners">listen to changes</a> made to any part of your data. This means your app will be fast, since you only spend rendering cycles on things that change. The optional <a href="#call-hooks-to-bind-to-data">bindings to React</a> and <a href="#pre-built-reactive-components">pre-built components</a> let you easily build fully reactive UIs on top of TinyBase. You even get a built-in <a href="#set-checkpoints-for-an-undo-stack">undo stack</a>, and <a href="#an-inspector-for-your-data">developer tools</a>!</p></section><section><h2 id="it-s-database-like">It&#x27;s <em>Database-Like</em></h2><p>Consumer app? Enterprise app? Or even a game? Model <a href="#start-with-a-simple-key-value-store">key-value data</a> and <a href="#level-up-to-use-tabular-data">tabular data</a> with optional typed <a href="#apply-schemas-to-tables-values">schematization</a>, whatever its data structures. There are built-in <a href="#create-indexes-for-fast-lookups">indexing</a>, <a href="#define-metrics-and-aggregations">metric aggregation</a>, and tabular <a href="#model-table-relationships">relationships</a> APIs - and a powerful <a href="#build-complex-queries-with-tinyql">query engine</a> to select, join, filter, and group data (reactively!) without SQL.</p></section><section><h2 id="it-synchronizes">It <em>Synchronizes</em></h2><p>TinyBase has <a href="#synchronize-between-devices">native CRDT</a> support, meaning that you can deterministically <a href="https://tinybase.org/guides/synchronization/">synchronize</a> and merge data across multiple sources, clients, and servers. And although TinyBase is an in-memory data store, but you can easily <a href="#persist-to-storage-sqlite-more">persist</a> your data to file, <a href="https://tinybase.org/api/persister-browser">browser storage</a>, <a href="https://tinybase.org/api/persister-indexed-db">IndexedDB</a>, <a href="https://tinybase.org/guides/persistence/database-persistence/">SQLite databases</a>, and <a href="https://tinybase.org/guides/persistence/third-party-crdt-persistence/">more</a>.</p></section><section><h2 id="it-s-built-for-a-local-first-world">It&#x27;s Built For A <em>Local-First</em> World</h2><p>TinyBase works anywhere that JavaScript does, but it&#x27;s especially great for local-first apps: where data is stored locally on the user&#x27;s device and that can be run offline. It&#x27;s tiny by name, tiny by nature: just <a href="#did-we-say-tiny">5.3kB - 12.7kB</a> and with no dependencies - yet <a href="#well-tested-and-documented">100% tested</a>, <a href="https://tinybase.org/guides/the-basics/getting-started/">fully documented</a>, and of course, <a href="https://github.com/tinyplex/tinybase">open source</a>!</p></section><hr><section id="friends"><h2 id="tinybase-works-great-on-its-own-but-also-plays-well-with-friends">TinyBase works great on its own, but also plays well with friends!</h2><div><a href="https://tinybase.org/guides/building-uis/getting-started-with-ui-react"><img width="48" src="https://tinybase.org/react.svg"> React</a></div><div><a href="https://tinybase.org/api/persister-partykit-client"><img width="48" src="https://tinybase.org/partykit.svg"> PartyKit</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/expo.svg">Expo SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/electric.svg">ElectricSQL</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/sqlite.svg"> SQLite</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/turso.svg">Turso</a></div><div><a href="https://tinybase.org/guides/schemas-and-persistence/database-persistence"><img width="48" src="https://tinybase.org/powersync.svg">PowerSync</a></div><div><a href="https://tinybase.org/api/persister-indexed-db/functions/creation/createindexeddbpersister"><img width="48" src="https://tinybase.org/indexeddb.svg"> IndexedDB</a></div><div><a href="https://tinybase.org/api/persister-yjs/functions/creation/createyjspersister"><img width="48" src="https://tinybase.org/yjs.svg"> YJS</a></div><div><a href="https://tinybase.org/api/persister-cr-sqlite-wasm"><img width="48" src="https://tinybase.org/crsqlite.png"> CR-SQLite</a></div><div><a href="https://tinybase.org/api/persister-automerge"><img width="48" src="https://tinybase.org/automerge.svg"> Automerge</a></div></section><hr><section id="follow"><a href="https://github.com/tinyplex/tinybase" target="_blank"><img src="https://img.shields.io/github/stars/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=GitHub&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://discord.com/invite/mGz3mevwP8" target="_blank"><img src="https://img.shields.io/discord/1027918215323590676?style=for-the-badge&amp;logo=discord&amp;logoColor=%23fff&amp;label=Discord&amp;labelColor=%233131e8&amp;color=%23333"> </a><a href="https://twitter.com/tinybasejs" target="_blank"><img src="https://img.shields.io/twitter/follow/tinybasejs?style=for-the-badge&amp;logo=x&amp;logoColor=%23fff&amp;label=Twitter&amp;labelColor=%23333&amp;color=%23333"></a><br><a href="https://github.com/tinyplex/tinybase/discussions" target="_blank"><img src="https://img.shields.io/github/discussions/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Ideas&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="https://github.com/tinyplex/tinybase/issues" target="_blank"><img src="https://img.shields.io/github/issues/tinyplex/tinybase?style=for-the-badge&amp;logo=GitHub&amp;logoColor=%23fff&amp;label=Issues&amp;labelColor=%23d81b60&amp;color=%23333"> </a><a href="#well-tested-and-documented"><img src="https://img.shields.io/badge/Tests-100%25-green?style=for-the-badge&amp;logo=jest&amp;logoColor=%23fff&amp;color=%23333&amp;labelColor=%2387c305"> </a><a href="https://www.npmjs.com/package/tinybase/v/5.1.5" target="_blank"><img src="https://img.shields.io/npm/v/tinybase?style=for-the-badge&amp;logo=npm&amp;logoColor=%23fff&amp;labelColor=%23bd0005&amp;color=%23333"></a></section><hr><section><h2 id="start-with-a-simple-key-value-store">Start with a simple key-value store.</h2><p>Creating a <a href="https://tinybase.org/api/store/interfaces/store/store/"><code>Store</code></a> requires just a simple call to the <a href="https://tinybase.org/api/store/functions/creation/createstore/"><code>createStore</code></a> function. Once you have one, you can easily set <a href="https://tinybase.org/api/store/type-aliases/store/values/"><code>Values</code></a> in it by unique <a href="https://tinybase.org/api/common/type-aliases/identity/id/"><code>Id</code></a>. And of course you can easily get them back out again.</p><p>Read more about using keyed value data in <a href="https://tinybase.org/guides/the-basics/">The Basics</a> guide.</p></section>
2
2
 
3
3
  ```js
4
4
  import {createStore} from 'tinybase';
@@ -292,4 +292,4 @@ export const createShop: typeof createShopDecl = () => {
292
292
  };
293
293
  ```
294
294
 
295
- <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&#x27;ll only add a gzipped <em>5.3kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>12.7kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>4.6kB</em>, the ui-react-dom components are another <em>2.5kB</em>, and everything is super fast. Life&#x27;s easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged 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> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.3kB</td><td>52.5kB</td></tr><tr><th class="right">tinybase (complete)</th><td>12.7kB</td><td>130.8kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react/">ui-react</a></th><td>4.6kB</td><td>48.3kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.5kB</td><td>20.4kB</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 for you to get your TinyBase-powered app 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>2,380</td><td>2,380</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,567</td><td>2,567</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,006</td><td>1,006</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>951</td><td>951</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">6,851</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,074</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img title="cpojer" src="https://github.com/cpojer.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img title="beekeeb" src="https://github.com/beekeeb.png?size=48" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img title="cancelself" src="https://github.com/cancelself.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img title="arpitBhalla" src="https://github.com/arpitBhalla.png?size=48" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/Apocalypsor" target="_blank"><img title="Apocalypsor" src="https://github.com/Apocalypsor.png?size=48" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img title="brentvatne" src="https://github.com/brentvatne.png?size=48" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img title="byCedric" src="https://github.com/byCedric.png?size=48" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img title="circadian-risk" src="https://github.com/circadian-risk.png?size=48" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img title="cpojer" src="https://github.com/cpojer.png?size=48" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img title="cubecull" src="https://github.com/cubecull.png?size=48" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img title="erwinkn" src="https://github.com/erwinkn.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img title="ezra-en" src="https://github.com/ezra-en.png?size=48" width="48" height="48"></a><a href="https://github.com/fdfontes" target="_blank"><img title="fdfontes" src="https://github.com/fdfontes.png?size=48" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img title="feychenie" src="https://github.com/feychenie.png?size=48" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img title="flaming-codes" src="https://github.com/flaming-codes.png?size=48" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img title="fostertheweb" src="https://github.com/fostertheweb.png?size=48" width="48" height="48"></a><a href="https://github.com/generates" target="_blank"><img title="generates" src="https://github.com/generates.png?size=48" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img title="Giulio987" src="https://github.com/Giulio987.png?size=48" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img title="itsdevcoffee" src="https://github.com/itsdevcoffee.png?size=48" width="48" height="48"></a><a href="https://github.com/jaysc" target="_blank"><img title="jaysc" src="https://github.com/jaysc.png?size=48" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img title="jbolda" src="https://github.com/jbolda.png?size=48" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img title="Kayoo-asso" src="https://github.com/Kayoo-asso.png?size=48" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img title="kotofurumiya" src="https://github.com/kotofurumiya.png?size=48" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img title="Kudo" src="https://github.com/Kudo.png?size=48" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img title="learn-anything" src="https://github.com/learn-anything.png?size=48" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img title="lluc" src="https://github.com/lluc.png?size=48" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img title="marksteve" src="https://github.com/marksteve.png?size=48" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img title="miking-the-viking" src="https://github.com/miking-the-viking.png?size=48" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img title="mjamesderocher" src="https://github.com/mjamesderocher.png?size=48" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img title="mouktardev" src="https://github.com/mouktardev.png?size=48" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img title="nickmessing" src="https://github.com/nickmessing.png?size=48" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img title="nikitavoloboev" src="https://github.com/nikitavoloboev.png?size=48" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img title="nkzw-tech" src="https://github.com/nkzw-tech.png?size=48" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img title="palerdot" src="https://github.com/palerdot.png?size=48" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img title="PorcoRosso85" src="https://github.com/PorcoRosso85.png?size=48" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img title="primodiumxyz" src="https://github.com/primodiumxyz.png?size=48" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img title="shaneosullivan" src="https://github.com/shaneosullivan.png?size=48" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img title="sudo-self" src="https://github.com/sudo-self.png?size=48" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img title="SuperSonicHub1" src="https://github.com/SuperSonicHub1.png?size=48" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img title="threepointone" src="https://github.com/threepointone.png?size=48" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img title="uptonking" src="https://github.com/uptonking.png?size=48" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img title="ViktorZhurbin" src="https://github.com/ViktorZhurbin.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a></section><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 id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>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 as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
295
+ <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&#x27;ll only add a gzipped <em>5.3kB</em> to your app. Incrementally add the other modules as you need more functionality, or get it all for <em>12.7kB</em>.</p><p>The optional <a href="https://tinybase.org/api/ui-react/"><code>ui-react</code></a> module is just <em>4.6kB</em>, the ui-react-dom components are another <em>2.5kB</em>, and everything is super fast. Life&#x27;s easy when you have zero dependencies!</p><p>Read more about how TinyBase is structured and packaged 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> </th><th>Minified .js.gz</th><th>Source .js</th></tr><tr><th class="right"><a href="https://tinybase.org/api/store/">tinybase/store</a> (minimal)</th><td>5.3kB</td><td>52.5kB</td></tr><tr><th class="right">tinybase (complete)</th><td>12.7kB</td><td>130.9kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react/">ui-react</a></th><td>4.6kB</td><td>48.3kB</td></tr><tr><th class="right"><a href="https://tinybase.org/api/ui-react-dom/">ui-react-dom</a></th><td>2.5kB</td><td>20.4kB</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 for you to get your TinyBase-powered app 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>2,389</td><td>2,389</td><td>100.0%</td></tr><tr><th class="right">Statements</th><td>2,576</td><td>2,576</td><td>100.0%</td></tr><tr><th class="right">Functions</th><td>1,006</td><td>1,006</td><td>100.0%</td></tr><tr><th class="right">Branches</th><td>951</td><td>951</td><td>100.0%</td></tr><tr><th class="right">Tests</th><td colspan="3">6,853</td></tr><tr><th class="right">Assertions</th><td colspan="3">32,079</td></tr></tbody></table></div><hr><section id="sponsors"><h2 id="proud-to-be-sponsored-by">Proud to be sponsored by:</h2><a href="https://github.com/cpojer" target="_blank"><img title="cpojer" src="https://github.com/cpojer.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/beekeeb" target="_blank"><img title="beekeeb" src="https://github.com/beekeeb.png?size=48" width="48" height="48"></a><a href="https://github.com/cancelself" target="_blank"><img title="cancelself" src="https://github.com/cancelself.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a><a href="https://github.com/arpitBhalla" target="_blank"><img title="arpitBhalla" src="https://github.com/arpitBhalla.png?size=48" width="48" height="48"></a></section><section id="users"><h2 id="excited-to-be-used-by">Excited to be used by:</h2><a href="https://github.com/Apocalypsor" target="_blank"><img title="Apocalypsor" src="https://github.com/Apocalypsor.png?size=48" width="48" height="48"></a><a href="https://github.com/brentvatne" target="_blank"><img title="brentvatne" src="https://github.com/brentvatne.png?size=48" width="48" height="48"></a><a href="https://github.com/byCedric" target="_blank"><img title="byCedric" src="https://github.com/byCedric.png?size=48" width="48" height="48"></a><a href="https://github.com/circadian-risk" target="_blank"><img title="circadian-risk" src="https://github.com/circadian-risk.png?size=48" width="48" height="48"></a><a href="https://github.com/cpojer" target="_blank"><img title="cpojer" src="https://github.com/cpojer.png?size=48" width="48" height="48"></a><a href="https://github.com/cubecull" target="_blank"><img title="cubecull" src="https://github.com/cubecull.png?size=48" width="48" height="48"></a><a href="https://github.com/erwinkn" target="_blank"><img title="erwinkn" src="https://github.com/erwinkn.png?size=48" width="48" height="48"></a><a href="https://github.com/expo" target="_blank"><img title="expo" src="https://github.com/expo.png?size=48" width="48" height="48"></a><a href="https://github.com/ezra-en" target="_blank"><img title="ezra-en" src="https://github.com/ezra-en.png?size=48" width="48" height="48"></a><a href="https://github.com/fdfontes" target="_blank"><img title="fdfontes" src="https://github.com/fdfontes.png?size=48" width="48" height="48"></a><a href="https://github.com/feychenie" target="_blank"><img title="feychenie" src="https://github.com/feychenie.png?size=48" width="48" height="48"></a><a href="https://github.com/flaming-codes" target="_blank"><img title="flaming-codes" src="https://github.com/flaming-codes.png?size=48" width="48" height="48"></a><a href="https://github.com/fostertheweb" target="_blank"><img title="fostertheweb" src="https://github.com/fostertheweb.png?size=48" width="48" height="48"></a><a href="https://github.com/generates" target="_blank"><img title="generates" src="https://github.com/generates.png?size=48" width="48" height="48"></a><a href="https://github.com/Giulio987" target="_blank"><img title="Giulio987" src="https://github.com/Giulio987.png?size=48" width="48" height="48"></a><a href="https://github.com/itsdevcoffee" target="_blank"><img title="itsdevcoffee" src="https://github.com/itsdevcoffee.png?size=48" width="48" height="48"></a><a href="https://github.com/jaysc" target="_blank"><img title="jaysc" src="https://github.com/jaysc.png?size=48" width="48" height="48"></a><a href="https://github.com/jbolda" target="_blank"><img title="jbolda" src="https://github.com/jbolda.png?size=48" width="48" height="48"></a><a href="https://github.com/Kayoo-asso" target="_blank"><img title="Kayoo-asso" src="https://github.com/Kayoo-asso.png?size=48" width="48" height="48"></a><a href="https://github.com/kotofurumiya" target="_blank"><img title="kotofurumiya" src="https://github.com/kotofurumiya.png?size=48" width="48" height="48"></a><a href="https://github.com/Kudo" target="_blank"><img title="Kudo" src="https://github.com/Kudo.png?size=48" width="48" height="48"></a><a href="https://github.com/learn-anything" target="_blank"><img title="learn-anything" src="https://github.com/learn-anything.png?size=48" width="48" height="48"></a><a href="https://github.com/lluc" target="_blank"><img title="lluc" src="https://github.com/lluc.png?size=48" width="48" height="48"></a><a href="https://github.com/marksteve" target="_blank"><img title="marksteve" src="https://github.com/marksteve.png?size=48" width="48" height="48"></a><a href="https://github.com/miking-the-viking" target="_blank"><img title="miking-the-viking" src="https://github.com/miking-the-viking.png?size=48" width="48" height="48"></a><a href="https://github.com/mjamesderocher" target="_blank"><img title="mjamesderocher" src="https://github.com/mjamesderocher.png?size=48" width="48" height="48"></a><a href="https://github.com/mouktardev" target="_blank"><img title="mouktardev" src="https://github.com/mouktardev.png?size=48" width="48" height="48"></a><a href="https://github.com/nickmessing" target="_blank"><img title="nickmessing" src="https://github.com/nickmessing.png?size=48" width="48" height="48"></a><a href="https://github.com/nikitavoloboev" target="_blank"><img title="nikitavoloboev" src="https://github.com/nikitavoloboev.png?size=48" width="48" height="48"></a><a href="https://github.com/nkzw-tech" target="_blank"><img title="nkzw-tech" src="https://github.com/nkzw-tech.png?size=48" width="48" height="48"></a><a href="https://github.com/palerdot" target="_blank"><img title="palerdot" src="https://github.com/palerdot.png?size=48" width="48" height="48"></a><a href="https://github.com/PorcoRosso85" target="_blank"><img title="PorcoRosso85" src="https://github.com/PorcoRosso85.png?size=48" width="48" height="48"></a><a href="https://github.com/primodiumxyz" target="_blank"><img title="primodiumxyz" src="https://github.com/primodiumxyz.png?size=48" width="48" height="48"></a><a href="https://github.com/shaneosullivan" target="_blank"><img title="shaneosullivan" src="https://github.com/shaneosullivan.png?size=48" width="48" height="48"></a><a href="https://github.com/sudo-self" target="_blank"><img title="sudo-self" src="https://github.com/sudo-self.png?size=48" width="48" height="48"></a><a href="https://github.com/SuperSonicHub1" target="_blank"><img title="SuperSonicHub1" src="https://github.com/SuperSonicHub1.png?size=48" width="48" height="48"></a><a href="https://github.com/threepointone" target="_blank"><img title="threepointone" src="https://github.com/threepointone.png?size=48" width="48" height="48"></a><a href="https://github.com/uptonking" target="_blank"><img title="uptonking" src="https://github.com/uptonking.png?size=48" width="48" height="48"></a><a href="https://github.com/ViktorZhurbin" target="_blank"><img title="ViktorZhurbin" src="https://github.com/ViktorZhurbin.png?size=48" width="48" height="48"></a><a href="https://github.com/WonderPanda" target="_blank"><img title="WonderPanda" src="https://github.com/WonderPanda.png?size=48" width="48" height="48"></a></section><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 id="about"><h2 id="about">About</h2><p>Modern apps deserve better. Why trade reactive user experiences to be able to use relational data? Or sacrifice features for bundle size? And why does the cloud do all the work <a href="https://localfirstweb.dev/" target="_blank">anyway</a>?</p><p>Building TinyBase was originally an interesting exercise for <a rel="me" href="https://tripleodeon.com">me</a> in API design, minification, and documentation. But now it has taken on a life of its own, and has grown beyond my wildest expectations.</p><p>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 as much as I do building it!</p></section><section id="story"><h2 id="the-story">The story</h2><a href="https://youtu.be/hXL7OkW-Prk?t=1232" target="_blank"><img src="https://tinybase.org/youtube.webp"></a></section>
@@ -321,13 +321,15 @@ const getListenerFunctions = (getThing) => {
321
321
  ([listener, , path = [], pathGetters, extraArgsGetter]) => {
322
322
  const callWithIds = (...ids) => {
323
323
  const index = size(ids);
324
- index == size(path)
325
- ? listener(thing, ...ids, ...extraArgsGetter(ids))
326
- : isUndefined(path[index])
327
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
328
- callWithIds(...ids, id2),
329
- )
330
- : callWithIds(...ids, path[index]);
324
+ if (index == size(path)) {
325
+ listener(thing, ...ids, ...extraArgsGetter(ids));
326
+ } else if (isUndefined(path[index])) {
327
+ arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
328
+ callWithIds(...ids, id2),
329
+ );
330
+ } else {
331
+ callWithIds(...ids, path[index]);
332
+ }
331
333
  };
332
334
  callWithIds();
333
335
  },
@@ -321,13 +321,15 @@ const getListenerFunctions = (getThing) => {
321
321
  ([listener, , path = [], pathGetters, extraArgsGetter]) => {
322
322
  const callWithIds = (...ids) => {
323
323
  const index = size(ids);
324
- index == size(path)
325
- ? listener(thing, ...ids, ...extraArgsGetter(ids))
326
- : isUndefined(path[index])
327
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
328
- callWithIds(...ids, id2),
329
- )
330
- : callWithIds(...ids, path[index]);
324
+ if (index == size(path)) {
325
+ listener(thing, ...ids, ...extraArgsGetter(ids));
326
+ } else if (isUndefined(path[index])) {
327
+ arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
328
+ callWithIds(...ids, id2),
329
+ );
330
+ } else {
331
+ callWithIds(...ids, path[index]);
332
+ }
331
333
  };
332
334
  callWithIds();
333
335
  },
package/store/index.js CHANGED
@@ -131,7 +131,9 @@ const mapToObj = (map, valueMapper, excludeMapValue, excludeObjValue) => {
131
131
  collForEach(map, (mapValue, id) => {
132
132
  if (!excludeMapValue?.(mapValue, id)) {
133
133
  const objValue = valueMapper ? valueMapper(mapValue, id) : mapValue;
134
- excludeObjValue?.(objValue) ? 0 : (obj[id] = objValue);
134
+ if (!excludeObjValue?.(objValue)) {
135
+ obj[id] = objValue;
136
+ }
135
137
  }
136
138
  });
137
139
  return obj;
@@ -257,13 +259,15 @@ const getListenerFunctions = (getThing) => {
257
259
  ([listener, , path = [], pathGetters, extraArgsGetter]) => {
258
260
  const callWithIds = (...ids) => {
259
261
  const index = size(ids);
260
- index == size(path)
261
- ? listener(thing, ...ids, ...extraArgsGetter(ids))
262
- : isUndefined(path[index])
263
- ? arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
264
- callWithIds(...ids, id2),
265
- )
266
- : callWithIds(...ids, path[index]);
262
+ if (index == size(path)) {
263
+ listener(thing, ...ids, ...extraArgsGetter(ids));
264
+ } else if (isUndefined(path[index])) {
265
+ arrayForEach(pathGetters[index]?.(...ids) ?? [], (id2) =>
266
+ callWithIds(...ids, id2),
267
+ );
268
+ } else {
269
+ callWithIds(...ids, path[index]);
270
+ }
267
271
  };
268
272
  callWithIds();
269
273
  },
@@ -634,7 +638,11 @@ const createStore = () => {
634
638
  cellIdsChanged(tableId, rowId, cellId2, -1);
635
639
  mapSet(row, cellId2);
636
640
  };
637
- isUndefined(defaultCell) ? delCell2(cellId) : mapForEach(row, delCell2);
641
+ if (isUndefined(defaultCell)) {
642
+ delCell2(cellId);
643
+ } else {
644
+ mapForEach(row, delCell2);
645
+ }
638
646
  if (collIsEmpty(row)) {
639
647
  rowIdsChanged(tableId, rowId, -1);
640
648
  if (collIsEmpty(mapSet(table, rowId))) {