Skip to content

Commit 9f4e1d3

Browse files
committed
v9.4.0-beta.2
1 parent 3f55fad commit 9f4e1d3

272 files changed

Lines changed: 7489 additions & 1750 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tests":8959,"assertions":37548,"lines":{"total":5060,"covered":5060,"skipped":0,"pct":100},"statements":{"total":5479,"covered":5479,"skipped":0,"pct":100},"functions":{"total":2405,"covered":2405,"skipped":0,"pct":100},"branches":{"total":1736,"covered":1736,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
1+
{"tests":9000,"assertions":37748,"lines":{"total":5107,"covered":5107,"skipped":0,"pct":100},"statements":{"total":5527,"covered":5527,"skipped":0,"pct":100},"functions":{"total":2424,"covered":2424,"skipped":0,"pct":100},"branches":{"total":1761,"covered":1761,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}

docs/api/all.html

Lines changed: 37 additions & 35 deletions
Large diffs are not rendered by default.

docs/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/startautopersisting/article.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<nav><ul><li><a href="/">TinyBase</a></li><li><a href="/api/">API</a></li><li><a href="/api/persister-automerge/"><code>persister-automerge</code></a></li><li><a href="/api/persister-automerge/interfaces/">Interfaces</a></li><li><a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a></li><li><a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/">Lifecycle methods</a></li><li><a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/startautopersisting/"><code>startAutoPersisting</code></a></li></ul></nav><section class="s1" id="/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/startautopersisting/" data-id="sAP3"><h1><code>startAutoPersisting</code></h1><p>The startAutoPersist method is a convenience method that starts both automatic loading and saving of the <a href="/api/the-essentials/creating-stores/store/"><code>Store</code></a> data.</p><pre><code><span class="function"><a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/startautopersisting/">startAutoPersisting</a></span><span class="punctuation">(</span>
22
initialContent<span class="operator">?</span><span class="operator">:</span> <span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span> <span class="operator">|</span> <span class="punctuation">(</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span><span class="punctuation">,</span>
33
startSaveFirst<span class="operator">?</span><span class="operator">:</span> <span class="builtin">boolean</span><span class="punctuation">,</span>
4-
<span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">Promise</span><span class="operator">&lt;</span><span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span><span class="operator">></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>initialContent<span class="operator">?</span></code></th><td><code><span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span> <span class="operator">|</span> <span class="punctuation">(</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span></code></td><td><p>An optional <a href="/api/store/type-aliases/store/content/"><code>Content</code></a> object used when the underlying storage has not previously been populated.</p></td></tr><tr><th><code>startSaveFirst<span class="operator">?</span></code></th><td><code><span class="builtin">boolean</span></code></td><td><p>Whether to start saving before loading, defaulting to false.</p></td></tr><tr><th class="right">returns</th><td><code><span class="builtin">Promise</span><span class="operator">&lt;</span><span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span><span class="operator">></span></code></td><td><p></p><p>A Promise containing a reference to the <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> object.</p><p></p></td></tr></table></div><p>This simply runs the startAutoLoad and <a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/save/startautosave/"><code>startAutoSave</code></a> methods in sequence, and returns a Promise that resolves when both have completed.</p><p>This method can take <code>initialContent</code> to pass to the <a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/load/startautoload/"><code>startAutoLoad</code></a> method. See its documentation for more details.</p><p>If for some reason you want to start saving <em>before</em> you start loading, pass true as the second parameter.</p><section class="s2"><h2>Example</h2><p>and saving.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
4+
<span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">Promise</span><span class="operator">&lt;</span><span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span><span class="operator">></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>initialContent<span class="operator">?</span></code></th><td><code><span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span> <span class="operator">|</span> <span class="punctuation">(</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span></code></td><td><p>An optional <a href="/api/store/type-aliases/store/content/"><code>Content</code></a> object used when the underlying storage has not previously been populated.</p></td></tr><tr><th><code>startSaveFirst<span class="operator">?</span></code></th><td><code><span class="builtin">boolean</span></code></td><td><p>Whether to start saving before loading, defaulting to false.</p></td></tr><tr><th class="right">returns</th><td><code><span class="builtin">Promise</span><span class="operator">&lt;</span><span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span><span class="operator">></span></code></td><td><p></p><p>A Promise containing a reference to the <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> object.</p><p></p></td></tr></table></div><p>This simply runs the startAutoLoad and <a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/save/startautosave/"><code>startAutoSave</code></a> methods in sequence, and returns a Promise that resolves when both have completed.</p><p>If the second method fails after either half has partially started, both halves are stopped again before this method rejects. The original startup error is preserved if that cleanup also fails.</p><p>This method can take <code>initialContent</code> to pass to the <a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/load/startautoload/"><code>startAutoLoad</code></a> method. See its documentation for more details.</p><p>If for some reason you want to start saving <em>before</em> you start loading, pass true as the second parameter.</p><section class="s2"><h2>Example</h2><p>and saving.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createStore<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase'</span><span class="punctuation">;</span>
55
<span class="keyword">import</span> <span class="punctuation">{</span>createSessionPersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-browser'</span><span class="punctuation">;</span>
66

77
<span class="keyword">const</span> persister <span class="operator">=</span> <span class="function"><a href="/api/the-essentials/persisting-stores/createsessionpersister/">createSessionPersister</a></span><span class="punctuation">(</span><span class="function"><a href="/api/the-essentials/creating-stores/createstore/">createStore</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">,</span> <span class="string">'pets'</span><span class="punctuation">)</span><span class="punctuation">;</span>

0 commit comments

Comments
 (0)