[TMP 2] Plugins system. support directory structure and store system.(the plugin needs build at each project)
This commit is contained in:
@@ -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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user