Skip to content

Simplify internal state#58

Merged
severo merged 8 commits intomasterfrom
details
Feb 26, 2025
Merged

Simplify internal state#58
severo merged 8 commits intomasterfrom
details

Conversation

@severo
Copy link
Copy Markdown
Contributor

@severo severo commented Feb 26, 2025

We don't need a complex state with a reducter. It's simpler with a single state (Slice | undefined) and easier to understand, I think.

hasCompleteRow can be computed, no need to persist it in the state.
It's fast because we don't have more than 50-100 rows.

Also: I renamed SET_ROWS into FETCHED_ROWS_SLICE, as conceptually a
resolver takes action and decide what to do with it. But the action as
itself only described an event that occurred, not what the resolver
should do with it. Anyway, it's a NIT
@severo severo requested a review from platypii February 26, 2025 14:40
Copy link
Copy Markdown
Contributor

@platypii platypii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm amazed this was able to be simplified so much! Changes look good. Hard to predict some of the edge cases in state management in react, but if this works, it looks like a great improvement in clarity.

Comment thread src/HighTable.tsx Outdated
@severo severo merged commit dc3ea96 into master Feb 26, 2025
@severo severo deleted the details branch February 26, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants