@threlte/theatre 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @threlte/extras
2
2
 
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 8e1b3d4: Unsubscribe from theatre.js sheet object onDestroy
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  <script>import { TransformControls, useParent, useThrelte } from '@threlte/core';
2
- import { getContext } from 'svelte';
2
+ import { getContext, onDestroy } from 'svelte';
3
3
  import { DEG2RAD, RAD2DEG } from 'three/src/math/MathUtils';
4
4
  import { globalObjects, globalStudio } from '../consts';
5
5
  import { createRawEventDispatcher } from './createRawEventDispatcher';
@@ -138,7 +138,7 @@ const updateProjectionMatrixKeys = [
138
138
  'bottom',
139
139
  'aspect'
140
140
  ];
141
- object.onValuesChange((newValues) => {
141
+ const unsubscribe = object.onValuesChange((newValues) => {
142
142
  // assign new values to slot prop
143
143
  values = newValues;
144
144
  // dispatch events to parent component callbacks
@@ -176,6 +176,7 @@ object.onValuesChange((newValues) => {
176
176
  invalidate();
177
177
  });
178
178
  });
179
+ onDestroy(unsubscribe);
179
180
  export const read = () => {
180
181
  if (!$globalStudio)
181
182
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threlte/theatre",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)",
5
5
  "license": "MIT",
6
6
  "devDependencies": {