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

functions.ts 792B

12345678910111213141516171819202122232425262728
  1. import { toState } from '../redux/functions';
  2. import { IStateful } from './types';
  3. /**
  4. * Gets the value of a specific React {@code Component} prop of the currently
  5. * mounted {@link App}.
  6. *
  7. * @param {IStateful} stateful - The redux store or {@code getState}
  8. * function.
  9. * @param {string} propName - The name of the React {@code Component} prop of
  10. * the currently mounted {@code App} to get.
  11. * @returns {*} The value of the specified React {@code Component} prop of the
  12. * currently mounted {@code App}.
  13. */
  14. export function getAppProp(stateful: IStateful, propName: string) {
  15. const state = toState(stateful)['features/base/app'];
  16. if (state) {
  17. const { app } = state;
  18. if (app) {
  19. return app.props[propName];
  20. }
  21. }
  22. return undefined;
  23. }