Skip to content

Commit

Permalink
fix: revert shallorRef for cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Jul 29, 2023
1 parent 7bc714d commit 2a0e72f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion playground/auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {
Expand Down
4 changes: 2 additions & 2 deletions src/composables/useCamera/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, watchEffect, onUnmounted, shallowRef } from 'vue'
import { computed, watchEffect, onUnmounted, ref } from 'vue'
import { Camera, OrthographicCamera, PerspectiveCamera } from 'three'

import type { TresScene } from '../../types'
Expand All @@ -8,7 +8,7 @@ import type { TresContext } from '../useTresContextProvider'
export const useCamera = ({ sizes, scene }: Pick<TresContext, 'sizes'> & { scene: TresScene }) => {

// the computed does not trigger, when for example the camera postion changes
const cameras = shallowRef<Camera[]>([])
const cameras = ref<Camera[]>([])
const camera = computed<Camera | undefined>(
() => cameras.value[0]
)
Expand Down

0 comments on commit 2a0e72f

Please sign in to comment.