working somewhat ok

This commit is contained in:
Davor Hrg
2021-08-02 23:24:26 +02:00
parent 336501aaff
commit 77ee959c43
7 changed files with 253 additions and 36 deletions

View File

@@ -3,7 +3,7 @@ import { useIdeContext } from 'src/helpers/hooks/useIdeContext'
export const useRender = () => {
const { state, thunkDispatch } = useIdeContext()
return () => {
return (parameters) => {
thunkDispatch((dispatch, getState) => {
const state = getState()
dispatch({ type: 'setLoading' })
@@ -13,6 +13,7 @@ export const useRender = () => {
code: state.code,
viewerSize: state.viewerSize,
camera: state.camera,
parameters,
})
})
localStorage.setItem(makeCodeStoreKey(state.ideType), state.code)