Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
  • when should this compacter run?
    • every n actions added (compactEvery)
    • when history is at n length (highWaterMark, compactAtLength)
  • can the function signal when it should?
    • run the compacter every time
    • needs a private state (below) or
    • getCompacter({ n, highwater }) => compactingDispatcher()

we can compactingReducer, basically searches the last 50 actions for "stop" or "compact irrelevant" actions as we go.

  • will this update the scuttlebut update history as well? probs not unless we tie scuttlebutt history into orderedHistory
  • what about a filter function, which might run in reverse to do the same, but can be called generically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment