Skip to content

Commit 2d0b324

Browse files
committed
reset _fields in optimized filter()/find() methods
1 parent f162fbb commit 2d0b324

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/sharedMethods.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export default {
33
const record = this.schema.db.factory.newRecordModel("*", this)
44
const result = this.state.ids.find((id, i) => {
55
record._id = id
6+
record._fields = {}
67
return predicate.call(context, record, i)
78
})
89

@@ -15,6 +16,7 @@ export default {
1516

1617
return this.state.ids.reduce((acc, id, i) => {
1718
dummyRecord._id = id
19+
dummyRecord._fields = {}
1820
if (predicate.call(context, dummyRecord, i)) {
1921
acc.push(factory.newRecordModel(id, this))
2022
}

0 commit comments

Comments
 (0)