DIR : /home/kozerus/public_html/cropex/node/node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs

/home/kozerus/public_html/cropex/node/node_modules/framer-motion/dist/es/render/utils

import { addUniqueItem, removeItem } from '../../utils/array.mjs';
import { compareByDepth } from './compare-by-depth.mjs';

class FlatTree {
    constructor() {
        this.children = [];
        this.isDirty = false;
    }
    add(child) {
        addUniqueItem(this.children, child);
        this.isDirty = true;
    }
    remove(child) {
        removeItem(this.children, child);
        this.isDirty = true;
    }
    forEach(callback) {
        this.isDirty && this.children.sort(compareByDepth);
        this.isDirty = false;
        this.children.forEach(callback);
    }
}

export { FlatTree };
//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer