Skip to content

Commit 1cd3363

Browse files
patrickwehbePatrick Wehbe
andauthored
docs: fix README object example comment and deprecated size usage (#1073)
Co-authored-by: Patrick Wehbe <patrick.wehbe.applications@gmail.com>
1 parent 423fa94 commit 1cd3363

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ const user = {
181181
storage.set('user', JSON.stringify(user))
182182

183183
// Deserialize the JSON string into an object
184-
const jsonUser = storage.getString('user') // { 'username': 'Marc', 'age': 21 }
185-
const userObject = JSON.parse(jsonUser)
184+
const jsonUser = storage.getString('user') // '{ "username": "Marc", "age": 21 }'
185+
const userObject = JSON.parse(jsonUser) // { username: 'Marc', age: 21 }
186186
```
187187

188188
### Encryption
@@ -215,7 +215,7 @@ console.log(buffer) // [1, 100, 255]
215215

216216
```ts
217217
// get size of MMKV storage in bytes
218-
const size = storage.size
218+
const size = storage.byteSize
219219
if (size >= 4096) {
220220
// clean unused keys and clear memory cache
221221
storage.trim()

0 commit comments

Comments
 (0)