2021-06-27 09:07:20 +00:00
|
|
|
import { useSelector } from 'state'
|
|
|
|
import { getShapeUtils } from 'state/shape-utils'
|
2021-06-29 12:00:59 +00:00
|
|
|
import { deepCompareArrays } from 'utils'
|
|
|
|
import tld from 'utils/tld'
|
2021-06-27 09:07:20 +00:00
|
|
|
|
|
|
|
export default function useShapesToRender(): string[] {
|
|
|
|
return useSelector(
|
|
|
|
(s) =>
|
2021-06-29 12:00:59 +00:00
|
|
|
Object.values(tld.getPage(s.data).shapes)
|
2021-06-27 09:07:20 +00:00
|
|
|
.filter((shape) => shape && !getShapeUtils(shape).isForeignObject)
|
|
|
|
.map((shape) => shape.id),
|
|
|
|
deepCompareArrays
|
|
|
|
)
|
|
|
|
}
|