@threlte/core
Advanced tools
Comparing version 5.0.5 to 5.0.6
# @threlte/core | ||
## 5.0.6 | ||
### Patch Changes | ||
- 357bb54: fixes a bug where if the initial value was nullish, it wasn't reset | ||
## 5.0.5 | ||
@@ -4,0 +10,0 @@ |
import { onDestroy } from 'svelte'; | ||
import { useThrelte } from '../../hooks/useThrelte'; | ||
import { resolve } from './resolve'; | ||
const initialValueBeforeAttach = Symbol('initialValueBeforeAttach'); | ||
export const useAttach = () => { | ||
const { invalidate } = useThrelte(); | ||
let isAttached = false; | ||
let valueBeforeAttach; | ||
let valueBeforeAttach = initialValueBeforeAttach; | ||
let detachFn; | ||
@@ -49,5 +50,5 @@ // the target that the object is attached to | ||
} | ||
else if (attachedTo && attachedKey && valueBeforeAttach) { | ||
else if (attachedTo && attachedKey && valueBeforeAttach !== initialValueBeforeAttach) { | ||
attachedTo[attachedKey] = valueBeforeAttach; | ||
valueBeforeAttach = undefined; | ||
valueBeforeAttach = initialValueBeforeAttach; | ||
attachedTo = undefined; | ||
@@ -54,0 +55,0 @@ attachedKey = undefined; |
{ | ||
"name": "@threlte/core", | ||
"version": "5.0.5", | ||
"version": "5.0.6", | ||
"author": "Grischa Erbe <hello@legrisch.com> (https://legrisch.com)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
399833
6135