You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 551B

1234567891011121314151617
  1. /* @flow */
  2. import { toState } from '../redux';
  3. /**
  4. * Checks if a {@code Dialog} with a specific {@code component} is currently
  5. * open.
  6. *
  7. * @param {Function|Object} stateful - The redux store, the redux
  8. * {@code getState} function, or the redux state itself.
  9. * @param {React.Component} component - The {@code component} of a
  10. * {@code Dialog} to be checked.
  11. * @returns {boolean}
  12. */
  13. export function isDialogOpen(stateful: Function | Object, component: Object) {
  14. return toState(stateful)['features/base/dialog'].component === component;
  15. }