Skip to content

Commit

Permalink
docs: clarify how custom renderers should use on remove method
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarlorentzon committed Mar 2, 2022
1 parent 9d37f91 commit 0fe3427
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/docs/extension/three-custom-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class ThreeCubeRenderer {

### `onRemove`

ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our Three.js resources (and potential event listeners etc).
ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our Three.js resources (and potential event listeners etc). Everything that we created in the `onAdd` method should be disposed and cleaned up now.

```js
class ThreeCubeRenderer {
Expand Down
2 changes: 1 addition & 1 deletion doc/docs/extension/webgl-custom-renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class WebGLCubeRenderer {

### `onRemove`

ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our WebGL resources (and potential event listeners etc).
ICustomRenderer.[onRemove](/api/interfaces/viewer.icustomrenderer#onremove) is called when the renderer has been removed from the `Viewer` with the Viewer.[removeCustomRenderer](/api/classes/viewer.Viewer#addcustomrenderer) method. This gives us a chance to clean up our WebGL resources (and potential event listeners etc). Everything that we created in the `onAdd` method should be dispose and cleaned up now.

```js
class WebGLCubeRenderer {
Expand Down

0 comments on commit 0fe3427

Please sign in to comment.