Skip to content

Commit

Permalink
enh: improve fetched record buffer types (#3)
Browse files Browse the repository at this point in the history
* enh: improve fetched record buffer types

* Remove custom type

* Fix inline
  • Loading branch information
haecheonlee authored Jun 3, 2024
1 parent 0b38b27 commit efb5c0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/fetched-record-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class FetchedRecordBuffer {
}

addFetchedRecord(fetchedRecord: FetchedRecord) {
const newBuffer = Object.assign(Object.create(this), this)
const newBuffer: FetchedRecordBuffer = Object.assign(Object.create(this), this)
const { subject, changeAttributes } = fetchedRecord
const position = changeAttributes.position.toString()
const existingFetchedRecords = this.store[subject]?.[position]
Expand All @@ -35,7 +35,7 @@ export class FetchedRecordBuffer {
}

addFetchedRecords(fetchedRecords: FetchedRecord[]) {
let newBuffer = this
let newBuffer: FetchedRecordBuffer = this

fetchedRecords.forEach((fetchedRecord: FetchedRecord) => {
newBuffer = newBuffer.addFetchedRecord(fetchedRecord)
Expand Down

0 comments on commit efb5c0b

Please sign in to comment.