mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
update website
This commit is contained in:
@@ -8,8 +8,7 @@ there is any. Returns a <code>Promise</code> object.</p></div></div><div class="
|
||||
<code>Error</code> if there is any. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="removeitem"></a><span class="propType">static </span>removeItem<span class="propType">(key: string, callback?: ?(error: ?Error) => void)</span> <a class="hash-link" href="#removeitem">#</a></h4><div><p>Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="mergeitem"></a><span class="propType">static </span>mergeItem<span class="propType">(key: string, value: string, callback?: ?(error: ?Error) => void)</span> <a class="hash-link" href="#mergeitem">#</a></h4><div><p>Merges existing value with input value, assuming they are stringified json.
|
||||
Returns a <code>Promise</code> object. Not supported by all native implementations.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clear"></a><span class="propType">static </span>clear<span class="propType">(callback?: ?(error: ?Error) => void)</span> <a class="hash-link" href="#clear">#</a></h4><div><p>Erases <em>all</em> AsyncStorage for all clients, libraries, etc. You probably
|
||||
don't want to call this - use removeItem or multiRemove to clear only your
|
||||
own keys instead. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clearprefix"></a><span class="propType">static </span>clearPrefix<span class="propType">(prefix: string, callback?: ?(error: ?Error) => void)</span> <a class="hash-link" href="#clearprefix">#</a></h4><div><p>Erases all keys with a particular prefix. Useful if all your keys have a
|
||||
specific prefix.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="getallkeys"></a><span class="propType">static </span>getAllKeys<span class="propType">(callback?: ?(error: ?Error, keys: ?Array<string>) => void)</span> <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the app, for all callers, libraries, etc. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiget"></a><span class="propType">static </span>multiGet<span class="propType">(keys: Array<string>, callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void)</span> <a class="hash-link" href="#multiget">#</a></h4><div><p>multiGet invokes callback with an array of key-value pair arrays that
|
||||
own keys instead. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="getallkeys"></a><span class="propType">static </span>getAllKeys<span class="propType">(callback?: ?(error: ?Error, keys: ?Array<string>) => void)</span> <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the app, for all callers, libraries, etc. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiget"></a><span class="propType">static </span>multiGet<span class="propType">(keys: Array<string>, callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void)</span> <a class="hash-link" href="#multiget">#</a></h4><div><p>multiGet invokes callback with an array of key-value pair arrays that
|
||||
matches the input format of multiSet. Returns a <code>Promise</code> object.</p><p> multiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiset"></a><span class="propType">static </span>multiSet<span class="propType">(keyValuePairs: Array<Array<string>>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multiset">#</a></h4><div><p>multiSet and multiMerge take arrays of key-value array pairs that match
|
||||
the output of multiGet, e.g. Returns a <code>Promise</code> object.</p><p> multiSet([['k1', 'val1'], ['k2', 'val2']], cb);</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiremove"></a><span class="propType">static </span>multiRemove<span class="propType">(keys: Array<string>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multiremove">#</a></h4><div><p>Delete all the keys in the <code>keys</code> array. Returns a <code>Promise</code> object.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multimerge"></a><span class="propType">static </span>multiMerge<span class="propType">(keyValuePairs: Array<Array<string>>, callback?: ?(errors: ?Array<Error>) => void)</span> <a class="hash-link" href="#multimerge">#</a></h4><div><p>Merges existing values with input values, assuming they are stringified
|
||||
json. Returns a <code>Promise</code> object.</p><p>Not supported by all native implementations.</p></div></div></div></span></div><div><h3><a class="anchor" name="examples"></a><a class="edit-github" href="https://github.com/facebook/react-native/blob/master/Examples/UIExplorer/AsyncStorageExample.js">Edit on GitHub</a>Examples <a class="hash-link" href="#examples">#</a></h3><div class="prism language-javascript"><span class="token string">'use strict'</span><span class="token punctuation">;</span>
|
||||
|
||||
Reference in New Issue
Block a user