您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.js 663B

123456789101112131415161718
  1. // @flow
  2. import { toState } from '../base/redux';
  3. import { CALENDAR_ENABLED, DEFAULT_STATE } from './constants';
  4. /**
  5. * Returns the calendar state, considering the enabled/disabled state of the
  6. * feature. Since that is the normal Redux behaviour, this function will always
  7. * return an object (the default state if the feature is disabled).
  8. *
  9. * @param {Object | Function} stateful - An object or a function that can be
  10. * resolved to a Redux state by {@code toState}.
  11. * @returns {Object}
  12. */
  13. export function getCalendarState(stateful: Object | Function) {
  14. return CALENDAR_ENABLED
  15. ? toState(stateful)['features/calendar-sync'] : DEFAULT_STATE;
  16. }