使用redux reducer密钥的时间戳

时间:2016-03-30 20:44:54

标签: timestamp react-native redux reducers

我考虑在我的React-Native reducer中使用时间戳作为事件的键,使用以下模式:

events: ["1458337324","1458399999","1458442999","1458443999"],
event_types: {
  "1458227324":"NET::connected",
  "1458442999":"ACT::pause",
  ...

这是反模式吗?

其次,我计划使用时间戳来访问其他事件对象作为外键关系,因此我需要在每个reducer中使用相同的时间戳。我可以创建并发送每个操作的时间戳,但是每次都可以通过每个reducer发送一个全局时间戳吗?

0 个答案:

没有答案