Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change reducer layout to better match logic of counters, timers, events etc. #5

Open
marcus-grant opened this issue Sep 23, 2018 · 0 comments
Assignees
Labels
Iterate Iterations of existing code. Tend to involve speed, memory, quality of results.

Comments

@marcus-grant
Copy link
Owner

The reducer layout should be this:

state = {
  counters: {
     // old clock state minus globalTimer
  },
  globalTimer: {
    period: (number),
    isActive: (bool),
  },
  eventLog: {
    byId: {
      id: (string),
      type: (string),
      finishedOn: (number, epoch time),
    },
    byType: {
      typeA: (array of Ids in order of most recently finished),
      // ... and so on ...
    },
  },
}

And there should be a parent reducer that handles all the combined logic of the separate sliced reducers.

@marcus-grant marcus-grant added the Iterate Iterations of existing code. Tend to involve speed, memory, quality of results. label Sep 23, 2018
@marcus-grant marcus-grant self-assigned this Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Iterate Iterations of existing code. Tend to involve speed, memory, quality of results.
Projects
None yet
Development

No branches or pull requests

1 participant