remove async in store
This commit is contained in:
parent
5336d39952
commit
5f479c1fb6
@ -29,11 +29,11 @@ const Input = ({
|
||||
// set Value to global store and run Effects
|
||||
useEffect(() => {
|
||||
if (sourceValueName && debouncedValue) {
|
||||
calculationStore.setValue(sourceValueName, debouncedValue).then(() => {
|
||||
if (Effects && Effects.length > 0) {
|
||||
runEffects(Effects, calculationStore);
|
||||
}
|
||||
});
|
||||
calculationStore.setValue(sourceValueName, debouncedValue);
|
||||
}
|
||||
|
||||
if (Effects && Effects.length > 0) {
|
||||
runEffects(Effects, calculationStore);
|
||||
}
|
||||
}, [debouncedValue]);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ import React from "react";
|
||||
import { Flex } from "client/UIKit/grid";
|
||||
|
||||
const withTitle = (title) => (Component) => (props) => (
|
||||
<Flex>
|
||||
<Flex flexDirection="column">
|
||||
<div>{title}</div>
|
||||
<Component {...props} />
|
||||
</Flex>
|
||||
|
||||
@ -10,12 +10,10 @@ class CalculationStore {
|
||||
|
||||
getValue = (sourceValueName: SourceValueNames) =>
|
||||
this.values[sourceValueName];
|
||||
setValue = action(
|
||||
async (sourceValueName: SourceValueNames, newValue: any) => {
|
||||
this.values[sourceValueName] = newValue;
|
||||
// TODO: Run effect here
|
||||
}
|
||||
);
|
||||
setValue = action((sourceValueName: SourceValueNames, newValue: any) => {
|
||||
this.values[sourceValueName] = newValue;
|
||||
// TODO: Run effect here
|
||||
});
|
||||
|
||||
getStatus = (elementName: string) => this.statuses[elementName];
|
||||
setStatus = action((elementName: string, status: Status) => {
|
||||
|
||||
Reference in New Issue
Block a user