我有这段代码:

const OnLoadStatisticsTypes = loadOnMount('statisticsTypes', fetchStatisticsTypes, 'root')(StatisticBalloons)

export default loadOnMount('appsStatistics', fetchAppsStatistics, 'root')(OnLoadStatisticsTypes)


但是我不知道如何做得更好。我试过了。:

export default compose(
  loadOnMount('appsStatistics', fetchAppsStatistics, 'root'),
  loadOnMount('statisticsTypes', fetchStatisticsTypes, 'root'),
  StatisticBalloons
)


但也不行。

我该如何改善这个脚本?

最佳答案

是Redux的compose函数吗?

export default compose(
  loadOnMount('appsStatistics', fetchAppsStatistics, 'root'),
  loadOnMount('statisticsTypes', fetchStatisticsTypes, 'root')
)(StatisticBalloons)

10-07 23:51