MCPcopy Create free account
hub / github.com/dabbott/react-native-express / getValue

Function getValue

examples/files/app/useAsyncStorage.js:4–11  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2 const [item, setItem] = useState(defaultValue)
3
4 async function getValue() {
5 try {
6 const newItem = await AsyncStorage.getItem(key)
7 if (newItem !== item) {
8 setItem(newItem)
9 }
10 } catch (e) {}
11 }
12
13 async function setItem(newItem) {
14 try {

Callers 1

useItemFunction · 0.85

Calls 1

setItemFunction · 0.85

Tested by

no test coverage detected