Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
moved debounces to module scope
Browse files Browse the repository at this point in the history
  • Loading branch information
SYBIOTE committed Jul 12, 2023
1 parent cdaa009 commit 297f287
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ const rotation = new Quaternion()
*
* @type {class component}
*/
const updateCubeMapBakeDebounced = debounce(updateCubeMapBake, 500) //ms

export const PortalNodeEditor: EditorComponentType = (props) => {
const [portals, setPortals] = useState<Array<{ value: string; label: string }>>([])
const [bufferUrl, setBufferUrl] = useState<string>('')
Expand All @@ -92,8 +94,6 @@ export const PortalNodeEditor: EditorComponentType = (props) => {
setBufferUrl(url)
}

const updateCubeMapBakeDebounced = debounce(updateCubeMapBake, 500) //ms

useEffect(() => {
updateCubeMapBakeDebounced()
return () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import { EditorComponentType } from './Util'
*
* @type {Class component}
*/
const updateCubeMapBakeDebounced = debounce(updateScenePreview, 500) //ms

export const ScenePreviewCameraNodeEditor: EditorComponentType = (props) => {
const { t } = useTranslation()
const [bufferUrl, setBufferUrl] = useState<string>('')
Expand All @@ -66,8 +68,6 @@ export const ScenePreviewCameraNodeEditor: EditorComponentType = (props) => {
setBufferUrl(url)
}

const updateCubeMapBakeDebounced = debounce(updateScenePreview, 500) //ms

useEffect(() => {
updateCubeMapBakeDebounced()
return () => {
Expand Down

0 comments on commit 297f287

Please sign in to comment.