/* @flow */ import { toState } from '../redux'; /** * Checks if a Dialog with a specific component is currently * open. * * @param {Function|Object} stateful - The redux store, the redux * getState function, or the redux state itself. * @param {React.Component} component - The component of a * Dialog to be checked. * @returns {boolean} */ export function isDialogOpen(stateful: Function | Object, component: Object) { return toState(stateful)['features/base/dialog'].component === component; }