@@ -114,22 +114,30 @@ export function getRowProto<TData extends RowData>(table: Table<TData>) {
114114 proto . subRows = [ ] as const
115115
116116 proto . getValue = function ( columnId : string ) {
117+ /*
117118 if (this._valuesCache.hasOwnProperty(columnId)) {
118119 return this._valuesCache[columnId]
119120 }
121+ */
120122
121123 const column = table . getColumn ( columnId )
122124
123125 if ( ! column ?. accessorFn ) {
124126 return undefined
125127 }
126128
129+ return column . accessorFn (
130+ this . original as TData ,
131+ this . index
132+ ) as any
133+ /*
127134 this._valuesCache[columnId] = column.accessorFn(
128135 this.original as TData,
129136 this.index
130137 )
131138
132139 return this._valuesCache[columnId] as any
140+ */
133141 }
134142
135143 proto . getUniqueValues = function ( columnId : string ) {
@@ -149,8 +157,10 @@ export function getRowProto<TData extends RowData>(table: Table<TData>) {
149157 }
150158
151159 if ( ! column . columnDef . getUniqueValues ) {
152- this . _uniqueValuesCache [ columnId ] = [ this . getValue ( columnId ) ]
153- return this . _uniqueValuesCache [ columnId ]
160+ // Avoid unnecessary caching for unique values
161+ return [ this . getValue ( columnId ) ] ;
162+ // this._uniqueValuesCache[columnId] = [this.getValue(columnId)]
163+ // return this._uniqueValuesCache[columnId]
154164 }
155165
156166 this . _uniqueValuesCache [ columnId ] = column . columnDef . getUniqueValues (
@@ -199,16 +209,20 @@ export function getRowProto<TData extends RowData>(table: Table<TData>) {
199209
200210 proto . _getAllCellsByColumnId = memo (
201211 function ( this : Row < TData > ) {
202- return [ this . getAllCells ( ) ]
212+ // return [this.getAllCells()]
213+ return [ ]
203214 } ,
204- allCells => {
215+ ( ) => {
216+ throw new Error ( 'Row._getAllCellsByColumnId not implemented because it is a memory leak' )
217+ /*
205218 return allCells.reduce(
206219 (acc, cell) => {
207220 acc[cell.column.id] = cell
208221 return acc
209222 },
210223 {} as Record<string, Cell<TData, unknown>>
211224 )
225+ */
212226 } ,
213227 getMemoOptions ( table . options , 'debugRows' , 'getAllCellsByColumnId' )
214228 )
@@ -236,7 +250,7 @@ export const createRow = <TData extends RowData>(
236250 original,
237251 depth,
238252 parentId,
239- _valuesCache : { } ,
253+ // _valuesCache: {},
240254 } )
241255
242256 if ( subRows ) {
0 commit comments