[TMP 2] Plugins system. support directory structure and store system.(the plugin needs build at each project)

This commit is contained in:
Sakamoto Shiina
2025-03-08 18:43:56 +09:00
parent 22ada89fa6
commit 48c6e7d69f
5 changed files with 59 additions and 42 deletions

View File

@@ -1,19 +1,18 @@
import { useStore } from "../store/store";
export const MainContainer = () => {
const { updateCountPluginState, currentCountPluginState } = useStore("useStore_CountPluginState");
export const MainContainer = ({useStore_CountPluginState}) => {
const { updateCountPluginState, currentCountPluginState } = useStore_CountPluginState();
const incrementCount = () => {
updateCountPluginState((prev_value) => {
return { count: prev_value.data.count + 1 }
});
updateCountPluginState((prev_value) => ({
count: prev_value.data.count + 1,
}));
};
return (
<div>
<p>Dev Plugin Count: {currentCountPluginState?.data?.count}</p>
<button onClick={incrementCount}>
Increment Plugin Count
</button>
<p>1 Zipped Dev Plugin Count: {currentCountPluginState?.data?.count}</p>
<button onClick={incrementCount}>Increment Plugin Count</button>
</div>
);
};