Skip to content

Make AppRefresher generic (Option + Source payload)#24

Merged
anthony1810 merged 1 commit into
mainfrom
feature/app-refresher-generic
Jun 8, 2026
Merged

Make AppRefresher generic (Option + Source payload)#24
anthony1810 merged 1 commit into
mainfrom
feature/app-refresher-generic

Conversation

@anthony1810

Copy link
Copy Markdown
Owner

Changes

  • Make AppRefresher generic over two app-defined types: Option (OptionSet, what to refresh) and Source (Sendable payload, typically an enum carrying the fresh object)
  • refresh(_ option:source:) — broadcast an option plus an optional payload; observers filter by option and receive the Source? payload
  • AppRefreshAction<Option, Source> carries option, source, and a unique id per emission (same option twice still triggers)
  • .appRefresherHost(option:source:) / .appRefresherHost(_:) and .onAppRefresh(_:behavior:perform:) with .onNextAppear (default) / .immediate
  • Update README App Refresh Bus section + API reference
  • 6 unit tests, all passing

Notes

  • Payload travels via the Source enum's associated values — lets a consumer update without a local DB (e.g. a brand-new Session).
  • Breaking change vs the 1.2.0 AppRefresher API.

@anthony1810 anthony1810 requested a review from ThangKM June 8, 2026 03:32

@ThangKM ThangKM left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@anthony1810 anthony1810 merged commit cd324b4 into main Jun 8, 2026
1 check passed
@anthony1810 anthony1810 deleted the feature/app-refresher-generic branch June 8, 2026 04:47
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