mirror of
https://github.com/ershisan99/flashcards-example-project.git
synced 2025-12-16 12:33:18 +00:00
[PR #1] [MERGED] feat: update readme with some new info #4
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ershisan99/flashcards-example-project/pull/1
Author: @ershisan99
Created: 12/16/2023
Status: ✅ Merged
Merged: 12/16/2023
Merged by: @ershisan99
Base:
master← Head:feature/update-readme📝 Commits (1)
440dc02feat: update readme with some new info📊 Changes
1 file changed (+1 additions, -27 deletions)
View changed files
📝
README.md(+1 -27)📄 Description
Stacks on top of https://github.com/bluesky-social/social-app/pull/2197.
This is a pretty chunky refactor but it's meant to mostly keep the data flow as is (with less plumbing).
The main change is we no longer pass down two things:
isScrolledDown. This is now maintained by whoever renders .
onScroll et al (onBeginDrag / onEndDrag / scrollEventThrottle). These are now in context (pager or top level).
More detailed:
The new List abstraction has onScrolledDownChanged (similar in spirit to onEndReached). You can use this to track isScrolledDown yourself next to the list. This is nice because it is used very close to the list in most cases. So it's just local state where it's needed. (In the future, we could make this use intersection observer instead of scroll events.)
The new List abstraction does not take onScroll at all. (We could allow that, but so far it's not used.)
Instead, there is a new concept of a "scroll provider". It's a thing with onScroll, onBeginDrag, and onEndDrag properties. List now delegates to the handlers from the closest scroll provider—this is the key change.
useOnMainScroll is gone, replaced by MainScrollProvider. That's used on Home and Notifications.
Pager doesn't pass onScroll down anymore, that's replaced by a ScrollProvider.
In principle scroll providers could compose but we don't have examples of that yet.
The List is the one doing useAnimatedScrollHandler now. Which avoids spreading that across the product code. I've removed throttle customization because we just always run this on the main thread already.
Note we could still support one-off onScroll handlers if needed. But all current uses are contextual.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.