integerated product context to scene context
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useActionHandler } from '../actions/useActionHandler';
|
||||
import { usePlayButtonStore, useResetButtonStore } from '../../../store/ui/usePlayButtonStore';
|
||||
import { determineExecutionOrder } from './functions/determineExecutionOrder';
|
||||
import { useProductContext } from '../products/productContext';
|
||||
import { useSceneContext } from '../../scene/sceneContext';
|
||||
import { useEffect } from "react";
|
||||
import { useActionHandler } from "../actions/useActionHandler";
|
||||
import { usePlayButtonStore, useResetButtonStore } from "../../../store/ui/usePlayButtonStore";
|
||||
import { determineExecutionOrder } from "./functions/determineExecutionOrder";
|
||||
import { useSceneContext } from "../../scene/sceneContext";
|
||||
|
||||
function Simulator() {
|
||||
const { selectedProductStore } = useProductContext();
|
||||
const { productStore } = useSceneContext();
|
||||
const { products, getProductById } = productStore();
|
||||
const { products, getProductById, selectedProduct } = productStore();
|
||||
const { handleAction } = useActionHandler();
|
||||
const { selectedProduct } = selectedProductStore();
|
||||
const { isPlaying } = usePlayButtonStore();
|
||||
const { isReset } = useResetButtonStore();
|
||||
|
||||
@@ -22,19 +19,12 @@ function Simulator() {
|
||||
|
||||
const executionOrder = determineExecutionOrder([product]);
|
||||
|
||||
executionOrder.forEach(action => {
|
||||
executionOrder.forEach((action) => {
|
||||
handleAction(action);
|
||||
});
|
||||
}, [products, isPlaying, isReset, selectedProduct]);
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<>
|
||||
|
||||
</>
|
||||
|
||||
);
|
||||
return <></>;
|
||||
}
|
||||
|
||||
export default Simulator;
|
||||
export default Simulator;
|
||||
|
||||
Reference in New Issue
Block a user