Skip to content

Commit 0a0f57f

Browse files
committed
v6.7.2
1 parent 9377629 commit 0a0f57f

File tree

111 files changed

+3634
-11518
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

+3634
-11518
lines changed

docs/api/all.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18149,11 +18149,11 @@
1814918149
<span class="comment">// -> '[{"pets":{"fido":{"species":"dog"}}},{}]'</span>
1815018150

1815118151
sessionStorage<span class="punctuation">.</span><span class="function"><a href="#/api/checkpoints/interfaces/checkpoints/checkpoints/methods/lifecycle/clear/">clear</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
18152-
</code></pre></section><section class="s7"><h6>Since</h6><p>v1.0.0</p></section></section><section class="s6" id="/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/methods/getter/getstoragename/" data-id="gSN3"><h6><code>getStorageName</code></h6><p>The <code>getStorageName</code> method returns the unique key of the storage location the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> is being persisted to.</p><pre><code><span class="function"><a href="#/api/persister-browser/interfaces/persister/localpersister/methods/getter/getstoragename/">getStorageName</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">string</span></code></pre><div class="table"><table><tr><th class="right">returns</th><td><code><span class="builtin">string</span></code></td><td><p></p><p>The unique key of the storage location.</p><p></p></td></tr></table></div><section class="s7"><h6>Example</h6><p>This example creates a <a href="#/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> object against a newly-created <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> and then gets the unique key of the storage location back out again.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span><span class="constant">MMKV</span><span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'react-native-mmkv'</span><span class="punctuation">;</span>
18152+
</code></pre></section><section class="s7"><h6>Since</h6><p>v1.0.0</p></section></section><section class="s6" id="/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/methods/getter/getstoragename/" data-id="gSN3"><h6><code>getStorageName</code></h6><p>The <code>getStorageName</code> method returns the unique key of the storage location the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> is being persisted to.</p><pre><code><span class="function"><a href="#/api/persister-browser/interfaces/persister/localpersister/methods/getter/getstoragename/">getStorageName</a></span><span class="punctuation">(</span><span class="punctuation">)</span><span class="operator">:</span> <span class="builtin">string</span></code></pre><div class="table"><table><tr><th class="right">returns</th><td><code><span class="builtin">string</span></code></td><td><p></p><p>The unique key of the storage location.</p><p></p></td></tr></table></div><section class="s7"><h6>Example</h6><p>This example creates a <a href="#/api/persisters/interfaces/persister/persister/"><code>Persister</code></a> object against a newly-created <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> and then gets the unique key of the storage location back out again.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createMMKV<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'react-native-mmkv'</span><span class="punctuation">;</span>
1815318153
<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>
1815418154
<span class="keyword">import</span> <span class="punctuation">{</span>createReactNativeMmkvPersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-react-native-mmkv'</span><span class="punctuation">;</span>
1815518155

18156-
<span class="keyword">const</span> storage <span class="operator">=</span> <span class="keyword">new</span> <span class="class-name">MMKV</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
18156+
<span class="keyword">const</span> storage <span class="operator">=</span> <span class="function">createMMKV</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
1815718157
<span class="keyword">const</span> store <span class="operator">=</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="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>
1815818158
<span class="keyword">const</span> persister <span class="operator">=</span> <span class="function"><a href="#/api/persister-react-native-mmkv/functions/creation/createreactnativemmkvpersister/">createReactNativeMmkvPersister</a></span><span class="punctuation">(</span>
1815918159
store<span class="punctuation">,</span>
@@ -18463,11 +18463,11 @@
1846318463
storage<span class="operator">:</span> <span class="constant">MMKV</span><span class="punctuation">,</span>
1846418464
storageName<span class="operator">?</span><span class="operator">:</span> <span class="builtin">string</span><span class="punctuation">,</span>
1846518465
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>
18466-
<span class="punctuation">)</span><span class="operator">:</span> <span class="type"><a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/">ReactNativeMmkvPersister</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/the-essentials/creating-stores/store/">Store</a></span> <span class="operator">|</span> <span class="type"><a href="#/api/mergeable-store/interfaces/mergeable/mergeablestore/">MergeableStore</a></span></code></td><td><p>The <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> or <a href="#/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> to persist.</p></td></tr><tr><th><code>storage</code></th><td><code><span class="constant">MMKV</span></code></td><td><p>The MMKV storage instance.</p></td></tr><tr><th><code>storageName<span class="operator">?</span></code></th><td><code><span class="builtin">string</span></code></td><td><p>The unique key to identify the storage location.</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/the-essentials/persisting-stores/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.</p></td></tr><tr><th class="right">returns</th><td><code><span class="type"><a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/">ReactNativeMmkvPersister</a></span></code></td><td><p></p><p>A reference to the new <a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/"><code>ReactNativeMmkvPersister</code></a> object.</p><p></p></td></tr></table></div><p>A <a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/"><code>ReactNativeMmkvPersister</code></a> supports both regular <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> and <a href="#/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> objects.</p><p>As well as providing a reference to the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> to persist, you must provide a <code>storage</code> parameter which identifies the MMKV storage instance.</p><p>The third argument is a <code>storageName</code> string that configures which key to use for the storage key.</p><section class="s5"><h5>Example</h5><p>This example creates a <a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/"><code>ReactNativeMmkvPersister</code></a> object and persists the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> to a MMKV storage instance as a JSON serialization into the <code>my_tinybase</code> key. It makes a change to the storage directly and then reloads it back into the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a>.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span><span class="constant">MMKV</span><span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'react-native-mmkv'</span><span class="punctuation">;</span>
18466+
<span class="punctuation">)</span><span class="operator">:</span> <span class="type"><a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/">ReactNativeMmkvPersister</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/the-essentials/creating-stores/store/">Store</a></span> <span class="operator">|</span> <span class="type"><a href="#/api/mergeable-store/interfaces/mergeable/mergeablestore/">MergeableStore</a></span></code></td><td><p>The <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> or <a href="#/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> to persist.</p></td></tr><tr><th><code>storage</code></th><td><code><span class="constant">MMKV</span></code></td><td><p>The MMKV storage instance.</p></td></tr><tr><th><code>storageName<span class="operator">?</span></code></th><td><code><span class="builtin">string</span></code></td><td><p>The unique key to identify the storage location.</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/the-essentials/persisting-stores/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.</p></td></tr><tr><th class="right">returns</th><td><code><span class="type"><a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/">ReactNativeMmkvPersister</a></span></code></td><td><p></p><p>A reference to the new <a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/"><code>ReactNativeMmkvPersister</code></a> object.</p><p></p></td></tr></table></div><p>A <a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/"><code>ReactNativeMmkvPersister</code></a> supports both regular <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> and <a href="#/api/mergeable-store/interfaces/mergeable/mergeablestore/"><code>MergeableStore</code></a> objects.</p><p>As well as providing a reference to the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> to persist, you must provide a <code>storage</code> parameter which identifies the MMKV storage instance.</p><p>The third argument is a <code>storageName</code> string that configures which key to use for the storage key.</p><section class="s5"><h5>Example</h5><p>This example creates a <a href="#/api/persister-react-native-mmkv/interfaces/persister/reactnativemmkvpersister/"><code>ReactNativeMmkvPersister</code></a> object and persists the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a> to a MMKV storage instance as a JSON serialization into the <code>my_tinybase</code> key. It makes a change to the storage directly and then reloads it back into the <a href="#/api/the-essentials/creating-stores/store/"><code>Store</code></a>.</p><pre><code><span class="keyword">import</span> <span class="punctuation">{</span>createMMKV<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'react-native-mmkv'</span><span class="punctuation">;</span>
1846718467
<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>
1846818468
<span class="keyword">import</span> <span class="punctuation">{</span>createReactNativeMmkvPersister<span class="punctuation">}</span> <span class="keyword">from</span> <span class="string">'tinybase/persisters/persister-react-native-mmkv'</span><span class="punctuation">;</span>
1846918469

18470-
<span class="keyword">const</span> storage <span class="operator">=</span> <span class="keyword">new</span> <span class="class-name">MMKV</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
18470+
<span class="keyword">const</span> storage <span class="operator">=</span> <span class="function">createMMKV</span><span class="punctuation">(</span><span class="punctuation">)</span><span class="punctuation">;</span>
1847118471
<span class="keyword">const</span> store <span class="operator">=</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="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>
1847218472
<span class="keyword">const</span> persister <span class="operator">=</span> <span class="function"><a href="#/api/persister-react-native-mmkv/functions/creation/createreactnativemmkvpersister/">createReactNativeMmkvPersister</a></span><span class="punctuation">(</span>
1847318473
store<span class="punctuation">,</span>

0 commit comments

Comments
 (0)