@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrai-innovations/reactive-helpers",
3
- "version": "8.1.3",
3
+ "version": "8.2.0",
4
4
  "description": "VueJS 3 utility composition functions to help manipulate objects and lists.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -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
- clearList();
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);