Removing a Maquette Projector

89 Views Asked by At

I noticed in the API that you can stop a Projector, but if it has already rendered some DOM, is there a way to remove it. It appears calling projector.stop() only causes the projector to stop responding.

2

There are 2 best solutions below

1
On BEST ANSWER

Since version 2.3, the maquette Projector has a detach function, which can be used to stop a renderMaquetteFunction. The return value contains the DOM Node that can be removed. This seems to be what you were looking for.

2
On

There is currently no way to instruct the projector to remove what has been rendered. You will have to keep track of which nodes you have appended/merged/etc and remove them yourself.