@arrai-innovations/reactive-helpers 8.1.3 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/use/listInstance.js +6 -2
package/package.json
CHANGED
package/use/listInstance.js
CHANGED
|
@@ -47,7 +47,7 @@ export function useListInstances(listInstanceArgs) {
|
|
|
47
47
|
return instances;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export function useListInstance({ props, functions = {} }) {
|
|
50
|
+
export function useListInstance({ props, functions = {}, keepOldPages = false }) {
|
|
51
51
|
if (!props) {
|
|
52
52
|
throw new ListError(`useListInstance requires props`);
|
|
53
53
|
}
|
|
@@ -114,7 +114,11 @@ export function useListInstance({ props, functions = {} }) {
|
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
const defaultPageCallback = (newObjects) => {
|
|
117
|
-
|
|
117
|
+
// with keepOldPages, you are responsible for clearing the list as needed
|
|
118
|
+
if (!keepOldPages) {
|
|
119
|
+
// display one page at a time, clear the list
|
|
120
|
+
clearList();
|
|
121
|
+
}
|
|
118
122
|
newObjects.forEach((newObject) => {
|
|
119
123
|
if (newObject.id in state.objects) {
|
|
120
124
|
updateListObject(newObject);
|