-
-
Notifications
You must be signed in to change notification settings - Fork 158
Labels
Milestone
Description
Description
As a maintainer of TresJS, I would like to clean up the core logic by refactoring it to use VueUse createInjectionState
https://vueuse.org/shared/createInjectionState/#createinjectionstate instead
Suggested solution
Replace manual context provider with something like:
const [useTresContextProvider, useTresContext] = createInjectionState((props, emit) => {
// Create refs with initial null values
const scene = shallowRef<TresScene | null>(null)
const renderer = shallowRef<WebGLRenderer | null>(null)
const camera = shallowRef<PerspectiveCamera | null>(null)
const loop = createRenderLoop()
// Render mode logic etc
})
export { useTresContext, useTresContextProvider }
Alternative
No response
Additional context
No response
Validations
- I agree to follow this project's Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done