Farmbot-Web-App/frontend/account/state_to_props.ts

15 lines
485 B
TypeScript
Raw Normal View History

2017-06-29 12:54:02 -06:00
import { Everything } from "../interfaces";
import { Props } from "./interfaces";
import { getUserAccountSettings } from "../resources/selectors";
2018-08-30 19:25:58 -06:00
import { getWebAppConfigValue } from "../config_storage/actions";
2017-06-29 12:54:02 -06:00
export function mapStateToProps(props: Everything): Props {
2017-08-28 05:49:13 -06:00
const user = getUserAccountSettings(props.resources.index);
2017-06-29 12:54:02 -06:00
return {
user,
2018-08-30 19:25:58 -06:00
dispatch: () => { throw new Error("NEVER SHOULD HAPPEN"); },
getConfigValue: getWebAppConfigValue(() => props),
2017-06-29 12:54:02 -06:00
};
}