Skip to content

Commit c910c3b

Browse files
committed
feat(macros)!: remove getStateArrayMapFunc
BREAKING CHANGE: getStateArrayMapFunc has been removed from macros. It was a map callback that called getState() on vtkObject items and passed primitives through unchanged. Inline the equivalent where needed, e.g. arr.map((item) => (item && item.isA ? item.getState() : item)).
1 parent a11970d commit c910c3b

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

BREAKING_CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## From 35.x to 36
2+
3+
- **macros**: `getStateArrayMapFunc` has been removed. Inline the equivalent where needed, e.g. `arr.map((item) => (item && item.isA ? item.getState() : item))`.
4+
5+
16
## From 34.x to 35
27

38
- **vtkMapper**: mappers should overwrite `computeBounds()` instead of `getBounds` that now calls `computeBounds()` before returning a copy of the mapper bounds.

Sources/macros.d.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,6 @@ declare function safeArrays(model: object): void;
140140
*/
141141
declare function enumToString(e: object, value: any): string;
142142

143-
/**
144-
* If item is a VtkObject, return its getState() otherwise return itself.
145-
*
146-
* @param item object to extract its state from
147-
*/
148-
declare function getStateArrayMapFunc(item: any): any;
149-
150143
/**
151144
* Call provided function on the next EDT pass
152145
*
@@ -725,7 +718,6 @@ declare const Macro: {
725718
get: typeof get;
726719
getArray: typeof getArray;
727720
getCurrentGlobalMTime(): Number;
728-
getStateArrayMapFunc: typeof getStateArrayMapFunc;
729721
isVtkObject: typeof isVtkObject;
730722
keystore: typeof keystore;
731723
measurePromiseExecution: typeof measurePromiseExecution;

Sources/macros.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,6 @@ function enumToString(e, value) {
212212
return Object.keys(e).find((key) => e[key] === value);
213213
}
214214

215-
function getStateArrayMapFunc(item) {
216-
if (item && item.isA) {
217-
return item.getState();
218-
}
219-
return item;
220-
}
221-
222215
// ----------------------------------------------------------------------------
223216
// setImmediate
224217
// ----------------------------------------------------------------------------
@@ -1797,7 +1790,6 @@ export default {
17971790
get,
17981791
getArray,
17991792
getCurrentGlobalMTime,
1800-
getStateArrayMapFunc,
18011793
isVtkObject,
18021794
keystore,
18031795
measurePromiseExecution,

0 commit comments

Comments
 (0)