Skip to content

Commit d69a139

Browse files
committed
v5.4.2
1 parent 237adfe commit d69a139

File tree

111 files changed

+238
-169
lines changed

Some content is hidden

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

111 files changed

+238
-169
lines changed

coverage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"tests":7463,"assertions":33200,"lines":{"total":2288,"covered":2288,"skipped":0,"pct":100},"statements":{"total":2472,"covered":2472,"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}}
1+
{"tests":7464,"assertions":33201,"lines":{"total":2290,"covered":2290,"skipped":0,"pct":100},"statements":{"total":2474,"covered":2474,"skipped":0,"pct":100},"functions":{"total":988,"covered":988,"skipped":0,"pct":100},"branches":{"total":856,"covered":856,"skipped":0,"pct":100},"branchesTrue":{"total":0,"covered":0,"skipped":0,"pct":100}}

docs/api/all.html

Lines changed: 69 additions & 49 deletions
Large diffs are not rendered by default.

docs/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/article.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<nav><ul><li><a href="/">TinyBase</a></li><li><a href="/api/">API</a></li><li><a href="/api/mergeable-store/"><code>mergeable-store</code></a></li><li><a href="/api/mergeable-store/interfaces/">Interfaces</a></li><li><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a></li><li><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/">Setter methods</a></li><li><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/"><code>setContent</code></a></li></ul></nav><section class="s1" id="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/" data-id="sC4"><h1><code>setContent</code></h1><p>The <code>setContent</code> method takes an array of two objects and sets the entire data of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</p><pre><code><span class="function"><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/">setContent</a></span><span class="punctuation">(</span>content<span class="operator">:</span> <span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span><span class="punctuation">)</span><span class="operator">:</span> <span class="keyword">this</span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>content</code></th><td><code><span class="type"><a href="/api/store/type-aliases/store/content/">Content</a></span></code></td><td><p>An array containing the tabular and keyed-value data of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to be set.</p></td></tr><tr><th class="right">returns</th><td><code><span class="keyword">this</span></code></td><td><p></p><p>A reference to the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</p><p></p></td></tr></table></div><p>This method will cause listeners to be called for any <a href="/api/store/type-aliases/store/table/"><code>Table</code></a>, <a href="/api/store/type-aliases/store/row/"><code>Row</code></a>, <a href="/api/store/type-aliases/store/cell/"><code>Cell</code></a>, <a href="/api/store/type-aliases/store/value/"><code>Value</code></a>, or <a href="/api/common/type-aliases/identity/id/"><code>Id</code></a> changes resulting from it.</p><p>Any part of the provided objects that are invalid (either according to the <a href="/api/store/type-aliases/store/tables/"><code>Tables</code></a> or <a href="/api/store/type-aliases/store/values/"><code>Values</code></a> type, or because it does not match a <a href="/api/store/type-aliases/schema/tablesschema/"><code>TablesSchema</code></a> or <a href="/api/store/type-aliases/schema/valuesschema/"><code>ValuesSchema</code></a> associated with the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>), will be ignored silently.</p><p>Assuming that at least some of the provided <a href="/api/store/type-aliases/store/tables/"><code>Tables</code></a> object or <a href="/api/store/type-aliases/store/values/"><code>Values</code></a> object is valid, any data that was already present in that part of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> will be completely overwritten. If either object is completely invalid, no change will be made to the corresponding part of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</p><p>The method returns a reference to the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> so that subsequent operations can be chained in a fluent style.</p><section class="s2"><h2>Examples</h2><p>This example sets the data of a <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</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>
1+
<nav><ul><li><a href="/">TinyBase</a></li><li><a href="/api/">API</a></li><li><a href="/api/mergeable-store/"><code>mergeable-store</code></a></li><li><a href="/api/mergeable-store/interfaces/">Interfaces</a></li><li><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a></li><li><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/">Setter methods</a></li><li><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/"><code>setContent</code></a></li></ul></nav><section class="s1" id="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/" data-id="sC4"><h1><code>setContent</code></h1><p>The <code>setContent</code> method takes an array of two objects and sets the entire data of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</p><pre><code><span class="function"><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/">setContent</a></span><span class="punctuation">(</span>content<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><span class="operator">:</span> <span class="keyword">this</span></code></pre><div class="table"><table><tr><th></th><th>Type</th><th>Description</th></tr><tr><th><code>content</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 array containing the tabular and keyed-value data of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> to be set, or a function that returns the array.</p></td></tr><tr><th class="right">returns</th><td><code><span class="keyword">this</span></code></td><td><p></p><p>A reference to the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</p><p></p></td></tr></table></div><p>This method will cause listeners to be called for any <a href="/api/store/type-aliases/store/table/"><code>Table</code></a>, <a href="/api/store/type-aliases/store/row/"><code>Row</code></a>, <a href="/api/store/type-aliases/store/cell/"><code>Cell</code></a>, <a href="/api/store/type-aliases/store/value/"><code>Value</code></a>, or <a href="/api/common/type-aliases/identity/id/"><code>Id</code></a> changes resulting from it.</p><p>Any part of the provided objects that are invalid (either according to the <a href="/api/store/type-aliases/store/tables/"><code>Tables</code></a> or <a href="/api/store/type-aliases/store/values/"><code>Values</code></a> type, or because it does not match a <a href="/api/store/type-aliases/schema/tablesschema/"><code>TablesSchema</code></a> or <a href="/api/store/type-aliases/schema/valuesschema/"><code>ValuesSchema</code></a> associated with the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>), will be ignored silently.</p><p>Assuming that at least some of the provided <a href="/api/store/type-aliases/store/tables/"><code>Tables</code></a> object or <a href="/api/store/type-aliases/store/values/"><code>Values</code></a> object is valid, any data that was already present in that part of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> will be completely overwritten. If either object is completely invalid, no change will be made to the corresponding part of the <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</p><p>The method returns a reference to the <a href="/api/store/interfaces/store/store/"><code>Store</code></a> so that subsequent operations can be chained in a fluent style.</p><p>Since v5.4.2, this method can also take a function that returns the content.</p><section class="s2"><h2>Examples</h2><p>This example sets the data of a <a href="/api/store/interfaces/store/store/"><code>Store</code></a>.</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>
22

33
<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/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/">setContent</a></span><span class="punctuation">(</span><span class="punctuation">[</span>
44
<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>
@@ -8,6 +8,16 @@
88
<span class="comment">// -> {pets: {fido: {species: 'dog'}}}</span>
99
console<span class="punctuation">.</span><span class="function">log</span><span class="punctuation">(</span>store<span class="punctuation">.</span><span class="function"><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/getter/getvalues/">getValues</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">)</span><span class="punctuation">;</span>
1010
<span class="comment">// -> {open: true, employees: 3}</span>
11+
</code></pre><p>This example sets the data of a <a href="/api/store/interfaces/store/store/"><code>Store</code></a> with the results of a function.</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>
12+
13+
<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/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/">setContent</a></span><span class="punctuation">(</span><span class="punctuation">(</span><span class="punctuation">)</span> <span class="operator">=></span> <span class="punctuation">[</span>
14+
<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>
15+
<span class="punctuation">{</span><span class="literal-property">open</span><span class="operator">:</span> <span class="boolean">true</span><span class="punctuation">,</span> <span class="literal-property">employees</span><span class="operator">:</span> <span class="number">3</span><span class="punctuation">}</span><span class="punctuation">,</span>
16+
<span class="punctuation">]</span><span class="punctuation">)</span><span class="punctuation">;</span>
17+
console<span class="punctuation">.</span><span class="function">log</span><span class="punctuation">(</span>store<span class="punctuation">.</span><span class="function"><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/getter/gettables/">getTables</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">)</span><span class="punctuation">;</span>
18+
<span class="comment">// -> {pets: {fido: {species: 'dog'}}}</span>
19+
console<span class="punctuation">.</span><span class="function">log</span><span class="punctuation">(</span>store<span class="punctuation">.</span><span class="function"><a href="/api/mergeable-store/interfaces/mergeable/mergeablestore/methods/getter/getvalues/">getValues</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">)</span><span class="punctuation">;</span>
20+
<span class="comment">// -> {open: true, employees: 3}</span>
1121
</code></pre><p>This example attempts to set the data of an existing <a href="/api/store/interfaces/store/store/"><code>Store</code></a> with partly invalid, and then completely invalid objects.</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>
1222

1323
<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/mergeable-store/interfaces/mergeable/mergeablestore/methods/setter/setcontent/">setContent</a></span><span class="punctuation">(</span><span class="punctuation">[</span>

0 commit comments

Comments
 (0)