More docs and annotations

This commit is contained in:
Aria Minaei 2021-09-18 21:43:29 +02:00
parent 60974c4273
commit 631bcba724
15 changed files with 214 additions and 46 deletions

View file

@ -218,6 +218,10 @@ const ProxyManager: VFC<ProxyManagerProps> = ({orbitControlsRef}) => {
})
}, [viewportShading, renderMaterials, sceneProxy])
const scrub = useMemo(() => {
return studio.debouncedScrub(1000)
}, [selected, editableProxyOfSelected])
if (!sceneProxy) {
return null
}
@ -235,7 +239,7 @@ const ProxyManager: VFC<ProxyManagerProps> = ({orbitControlsRef}) => {
const sheetObject = editableProxyOfSelected.sheetObject
const obj = editableProxyOfSelected.object
studio.transaction(({set}) => {
scrub.capture(({set}) => {
set(sheetObject.props, {
position: {
x: obj.position.x,

View file

@ -8,7 +8,7 @@ import useRefreshSnapshot from './useRefreshSnapshot'
* Alternatively you can use
* @link useRefreshSnapshot()
*
* @example
* Usage
* ```jsx
* <Suspense fallback={null}>
* <RefreshSnapshot />

View file

@ -4,8 +4,8 @@ import {useMemo, useState} from 'react'
/**
* Combines useRef() and useState().
*
* @example
* ```typescript
* Usage:
* ```ts
* const [ref, val] = useRefAndState<HTMLDivElement | null>(null)
*
* useEffect(() => {