react-virtualized
Advanced tools
Comparing version 9.2.3 to 9.3.0
Changelog | ||
------------ | ||
##### 9.3.0 | ||
* 🎉 Added `resetLoadMoreRowsCache` method to `InfiniteLoader` to reset any cached data about loaded rows. This method should be called if any/all loaded data needs to be refetched (eg a filtered list where the search criteria changes). ([#612](https://github.com/bvaughn/react-virtualized/issues/612)) | ||
##### 9.2.3 | ||
@@ -5,0 +8,0 @@ * 🐛 `CellMeasurer` should work better out of the box with `MultiGrid`. |
@@ -324,2 +324,19 @@ 'use strict'; | ||
}); | ||
it('resetLoadMoreRowsCache should reset memoized state', function () { | ||
var component = (0, _TestUtils.render)(getMarkup({ | ||
isRowLoaded: function isRowLoaded() { | ||
return false; | ||
}, | ||
minimumBatchSize: 20, | ||
threshold: 0 | ||
})); | ||
expect(loadMoreRowsCalls).toEqual([{ startIndex: 0, stopIndex: 19 }]); | ||
innerOnRowsRendered({ startIndex: 0, stopIndex: 15 }); | ||
loadMoreRowsCalls.splice(0); | ||
expect(loadMoreRowsCalls).toEqual([]); | ||
component.resetLoadMoreRowsCache(); | ||
innerOnRowsRendered({ startIndex: 0, stopIndex: 15 }); | ||
expect(loadMoreRowsCalls).toEqual([{ startIndex: 0, stopIndex: 19 }]); | ||
}); | ||
}); | ||
@@ -326,0 +343,0 @@ |
@@ -48,2 +48,7 @@ 'use strict'; | ||
_createClass(InfiniteLoader, [{ | ||
key: 'resetLoadMoreRowsCache', | ||
value: function resetLoadMoreRowsCache() { | ||
this._loadMoreRowsMemoizer = (0, _createCallbackMemoizer2.default)(); | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -50,0 +55,0 @@ value: function render() { |
@@ -312,2 +312,19 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
}); | ||
it('resetLoadMoreRowsCache should reset memoized state', function () { | ||
var component = render(getMarkup({ | ||
isRowLoaded: function isRowLoaded() { | ||
return false; | ||
}, | ||
minimumBatchSize: 20, | ||
threshold: 0 | ||
})); | ||
expect(loadMoreRowsCalls).toEqual([{ startIndex: 0, stopIndex: 19 }]); | ||
innerOnRowsRendered({ startIndex: 0, stopIndex: 15 }); | ||
loadMoreRowsCalls.splice(0); | ||
expect(loadMoreRowsCalls).toEqual([]); | ||
component.resetLoadMoreRowsCache(); | ||
innerOnRowsRendered({ startIndex: 0, stopIndex: 15 }); | ||
expect(loadMoreRowsCalls).toEqual([{ startIndex: 0, stopIndex: 19 }]); | ||
}); | ||
}); | ||
@@ -314,0 +331,0 @@ |
@@ -31,2 +31,7 @@ import _Object$getPrototypeOf from 'babel-runtime/core-js/object/get-prototype-of'; | ||
_createClass(InfiniteLoader, [{ | ||
key: 'resetLoadMoreRowsCache', | ||
value: function resetLoadMoreRowsCache() { | ||
this._loadMoreRowsMemoizer = createCallbackMemoizer(); | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -33,0 +38,0 @@ value: function render() { |
@@ -6,3 +6,3 @@ { | ||
"user": "bvaughn", | ||
"version": "9.2.3", | ||
"version": "9.3.0", | ||
"homepage": "https://github.com/bvaughn/react-virtualized", | ||
@@ -9,0 +9,0 @@ "main": "dist/commonjs/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2215113
32315