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.native.js 816B

123456789101112131415161718192021222324252627282930313233
  1. // @flow
  2. import { toState } from '../../redux';
  3. /**
  4. *
  5. * Returns the client width.
  6. *
  7. * @param {(Function|Object)} stateful - The (whole) redux state, or redux's
  8. * {@code getState} function to be used to retrieve the state
  9. * features/base/config.
  10. * @returns {number}.
  11. */
  12. export function getClientWidth(stateful: Object) {
  13. const state = toState(stateful)['features/base/responsive-ui'];
  14. return state.clientWidth;
  15. }
  16. /**
  17. *
  18. * Returns the client height.
  19. *
  20. * @param {(Function|Object)} stateful - The (whole) redux state, or redux's
  21. * {@code getState} function to be used to retrieve the state
  22. * features/base/config.
  23. * @returns {number}.
  24. */
  25. export function getClientHeight(stateful: Object) {
  26. const state = toState(stateful)['features/base/responsive-ui'];
  27. return state.clientHeight;
  28. }