Skip to content

Commit d21dee5

Browse files
nielsboeckerposva
authored andcommitted
docs(readme): fix example
* Update README.md If you `delete item['.key']`, then in the next line `this.$firebaseRefs.items.child(item['.key'])` means `this.$firebaseRefs.items.child(UNDEFINED)` * Update README.md * Update README.md
1 parent d7349ae commit d21dee5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ To delete or update an item you can use the `.key` property of a given object. B
190190
},
191191
updateItem: function (item) {
192192
// create a copy of the item
193-
item = {...item}
193+
const copy = {...item}
194194
// remove the .key attribute
195-
delete item['.key']
196-
this.$firebaseRefs.items.child(item['.key']).set(item)
195+
delete copy['.key']
196+
this.$firebaseRefs.items.child(item['.key']).set(copy)
197197
}
198198
```
199199

0 commit comments

Comments
 (0)