Skip to content

Commit b469744

Browse files
committed
v6.0.0-beta.3
1 parent b3d2505 commit b469744

File tree

1,348 files changed

+9070
-9004
lines changed

Some content is hidden

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

1,348 files changed

+9070
-9004
lines changed

coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tests":7063,"assertions":0,"lines":{"total":2292,"covered":2292,"skipped":0,"pct":100},"statements":{"total":2477,"covered":2477,"skipped":0,"pct":100},"functions":{"total":990,"covered":990,"skipped":0,"pct":100},"branches":{"total":854,"covered":854,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}
1+
{"tests":7063,"assertions":0,"lines":{"total":2289,"covered":2289,"skipped":0,"pct":100},"statements":{"total":2473,"covered":2473,"skipped":0,"pct":100},"functions":{"total":988,"covered":988,"skipped":0,"pct":100},"branches":{"total":854,"covered":854,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}

docs/api/all.html

Lines changed: 1695 additions & 1671 deletions
Large diffs are not rendered by default.

docs/api/persister-automerge/functions/creation/createautomergepersister/article.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
docMapName<span class="operator">?</span><span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">,</span>
55
onIgnoredError<span class="operator">?</span><span class="operator">:</span> <span class="punctuation">(</span>error<span class="operator">:</span> <span class="builtin">any</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">void</span><span class="punctuation">,</span>
66
<span class="punctuation">)</span><span class="operator">:</span> <span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>store</code></th><td><code><span class="type"><a href="/api/store/interfaces/store/store/">Store</a></span></code></td><td><p>The <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to persist.</p></td></tr><tr><th><code>docHandle</code></th><td><code>DocHandle<span class="operator">&lt;</span><span class="builtin">any</span><span class="operator">></span></code></td><td><p>The Automerge document handler to persist the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> with.</p></td></tr><tr><th><code>docMapName<span class="operator">?</span></code></th><td><code><span class="builtin">string</span></code></td><td><p>The name of the map used inside the Automerge document to sync the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to (which otherwise will default to &#x27;tinybase&#x27;).</p></td></tr><tr><th><code>onIgnoredError<span class="operator">?</span></code></th><td><code><span class="punctuation">(</span>error<span class="operator">:</span> <span class="builtin">any</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">void</span></code></td><td><p>An optional handler for the errors that the <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> would otherwise ignore when trying to save or load data. This is suitable for debugging persistence issues in a development environment, since v4.0.4.</p></td></tr><tr><th class="right">returns</th><td><code><span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span></code></td><td><p></p><p>A reference to the new <a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a> object.</p><p></p></td></tr></table></div><p>An <a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a> only supports regular <a href="/api/store/interfaces/store/store/"><code>Store</code></a> objects, and cannot be used to persist the metadata of a <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a>.</p><p>As well as providing a reference to the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to persist, you must provide the Automerge document handler to persist it with.</p><section class="s2"><h2>Examples</h2><p>This example creates a <a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a> object and persists the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to an Automerge document.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>Repo<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo'</span><span class="punctuation">;</span>
7-
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
87
<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>
8+
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
99

1010
<span class="keyword">const</span> docHandler <span class="operator">=</span> <span class="keyword">new</span> <span class="class-name">Repo</span><span class="punctuation">(</span><span class="punctuation">{</span><span class="literal-property">network</span><span class="operator">:</span> <span class="punctuation">[</span><span class="punctuation">]</span><span class="punctuation">}</span><span class="punctuation">)</span><span class="punctuation">.</span><span class="function">create</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
1111
<span class="keyword">const</span> store <span class="operator">=</span> <span class="function"><a href="/api/store/functions/creation/createstore/">createStore</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">.</span><span class="function"><a href="/api/store/interfaces/store/store/methods/setter/settables/">setTables</a></span><span class="punctuation">(</span><span class="punctuation">{</span><span class="literal-property">pets</span><span class="operator">:</span> <span class="punctuation">{</span><span class="literal-property">fido</span><span class="operator">:</span> <span class="punctuation">{</span><span class="literal-property">species</span><span class="operator">:</span> <span class="string">'dog'</span><span class="punctuation">}</span><span class="punctuation">}</span><span class="punctuation">}</span><span class="punctuation">)</span><span class="punctuation">;</span>
@@ -18,10 +18,10 @@
1818
<span class="comment">// -> {tinybase: {t: {pets: {fido: {species: 'dog'}}}, v: {}}}</span>
1919

2020
persister<span class="punctuation">.</span><span class="function"><a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/destroy/">destroy</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
21-
</code></pre><p>This more complex example uses Automerge networking to keep two <a href="/api/store/interfaces/store/store/"><code>Store</code></a> objects (each with their own <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects and Automerge documents) in sync with each other using a network.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>BroadcastChannelNetworkAdapter<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo-network-broadcastchannel'</span><span class="punctuation">;</span>
22-
<span class="keyword">import</span> <span class="punctuation">{</span>Repo<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo'</span><span class="punctuation">;</span>
23-
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
21+
</code></pre><p>This more complex example uses Automerge networking to keep two <a href="/api/store/interfaces/store/store/"><code>Store</code></a> objects (each with their own <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects and Automerge documents) in sync with each other using a network.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>Repo<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo'</span><span class="punctuation">;</span>
22+
<span class="keyword">import</span> <span class="punctuation">{</span>BroadcastChannelNetworkAdapter<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo-network-broadcastchannel'</span><span class="punctuation">;</span>
2423
<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>
24+
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
2525

2626
<span class="comment">// Bind the first Store to a network-enabled automerge-repo</span>
2727
<span class="keyword">const</span> repo1 <span class="operator">=</span> <span class="keyword">new</span> <span class="class-name">Repo</span><span class="punctuation">(</span><span class="punctuation">{</span>

docs/api/persister-automerge/functions/creation/createautomergepersister/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
docMapName<span class="operator">?</span><span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">,</span>
55
onIgnoredError<span class="operator">?</span><span class="operator">:</span> <span class="punctuation">(</span>error<span class="operator">:</span> <span class="builtin">any</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">void</span><span class="punctuation">,</span>
66
<span class="punctuation">)</span><span class="operator">:</span> <span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>store</code></th><td><code><span class="type"><a href="/api/store/interfaces/store/store/">Store</a></span></code></td><td><p>The <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to persist.</p></td></tr><tr><th><code>docHandle</code></th><td><code>DocHandle<span class="operator">&lt;</span><span class="builtin">any</span><span class="operator">></span></code></td><td><p>The Automerge document handler to persist the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> with.</p></td></tr><tr><th><code>docMapName<span class="operator">?</span></code></th><td><code><span class="builtin">string</span></code></td><td><p>The name of the map used inside the Automerge document to sync the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to (which otherwise will default to &#x27;tinybase&#x27;).</p></td></tr><tr><th><code>onIgnoredError<span class="operator">?</span></code></th><td><code><span class="punctuation">(</span>error<span class="operator">:</span> <span class="builtin">any</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="keyword">void</span></code></td><td><p>An optional handler for the errors that the <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> would otherwise ignore when trying to save or load data. This is suitable for debugging persistence issues in a development environment, since v4.0.4.</p></td></tr><tr><th class="right">returns</th><td><code><span class="type"><a href="/api/persister-automerge/interfaces/persister/automergepersister/">AutomergePersister</a></span></code></td><td><p></p><p>A reference to the new <a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a> object.</p><p></p></td></tr></table></div><p>An <a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a> only supports regular <a href="/api/store/interfaces/store/store/"><code>Store</code></a> objects, and cannot be used to persist the metadata of a <a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a>.</p><p>As well as providing a reference to the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to persist, you must provide the Automerge document handler to persist it with.</p><section class="s2"><h2>Examples</h2><p>This example creates a <a href="/api/persister-automerge/interfaces/persister/automergepersister/"><code>AutomergePersister</code></a> object and persists the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to an Automerge document.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>Repo<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo'</span><span class="punctuation">;</span>
7-
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
87
<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>
8+
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
99

1010
<span class="keyword">const</span> docHandler <span class="operator">=</span> <span class="keyword">new</span> <span class="class-name">Repo</span><span class="punctuation">(</span><span class="punctuation">{</span><span class="literal-property">network</span><span class="operator">:</span> <span class="punctuation">[</span><span class="punctuation">]</span><span class="punctuation">}</span><span class="punctuation">)</span><span class="punctuation">.</span><span class="function">create</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
1111
<span class="keyword">const</span> store <span class="operator">=</span> <span class="function"><a href="/api/store/functions/creation/createstore/">createStore</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">.</span><span class="function"><a href="/api/store/interfaces/store/store/methods/setter/settables/">setTables</a></span><span class="punctuation">(</span><span class="punctuation">{</span><span class="literal-property">pets</span><span class="operator">:</span> <span class="punctuation">{</span><span class="literal-property">fido</span><span class="operator">:</span> <span class="punctuation">{</span><span class="literal-property">species</span><span class="operator">:</span> <span class="string">'dog'</span><span class="punctuation">}</span><span class="punctuation">}</span><span class="punctuation">}</span><span class="punctuation">)</span><span class="punctuation">;</span>
@@ -18,10 +18,10 @@
1818
<span class="comment">// -> {tinybase: {t: {pets: {fido: {species: 'dog'}}}, v: {}}}</span>
1919

2020
persister<span class="punctuation">.</span><span class="function"><a href="/api/persister-automerge/interfaces/persister/automergepersister/methods/lifecycle/destroy/">destroy</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
21-
</code></pre><p>This more complex example uses Automerge networking to keep two <a href="/api/store/interfaces/store/store/"><code>Store</code></a> objects (each with their own <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects and Automerge documents) in sync with each other using a network.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>BroadcastChannelNetworkAdapter<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo-network-broadcastchannel'</span><span class="punctuation">;</span>
22-
<span class="keyword">import</span> <span class="punctuation">{</span>Repo<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo'</span><span class="punctuation">;</span>
23-
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
21+
</code></pre><p>This more complex example uses Automerge networking to keep two <a href="/api/store/interfaces/store/store/"><code>Store</code></a> objects (each with their own <a href="/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> objects and Automerge documents) in sync with each other using a network.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>Repo<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo'</span><span class="punctuation">;</span>
22+
<span class="keyword">import</span> <span class="punctuation">{</span>BroadcastChannelNetworkAdapter<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'@automerge/automerge-repo-network-broadcastchannel'</span><span class="punctuation">;</span>
2423
<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>
24+
<span class="keyword">import</span> <span class="punctuation">{</span>createAutomergePersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-automerge'</span><span class="punctuation">;</span>
2525

2626
<span class="comment">// Bind the first Store to a network-enabled automerge-repo</span>
2727
<span class="keyword">const</span> repo1 <span class="operator">=</span> <span class="keyword">new</span> <span class="class-name">Repo</span><span class="punctuation">(</span><span class="punctuation">{</span>

0 commit comments

Comments
 (0)