import { omit } from '../utils';
const syncActors = ({ scene, prevScene, editorScene, actorCollection, actorCreator, }) => {
    const { actors } = scene;
    const { actors: prevActors } = prevScene;
    prevActors.forEach((actorConfig) => {
        const actor = actorCollection.getById(actorConfig.id);
        actor === null || actor === void 0 ? void 0 : actor.remove();
    });
    actors.forEach((actorConfig) => {
        editorScene.appendChild(actorCreator.create(omit(actorConfig)));
    });
};
export const watchActors = (options) => {
    const { scene } = options;
    if (!scene) {
        return;
    }
    syncActors(options);
};
