-
Notifications
You must be signed in to change notification settings - Fork 23
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
Feat/async start and updateContext overloads #90
Feat/async start and updateContext overloads #90
Conversation
MainActor required for Poller timer to successfully run on the RunLoop
MainActor required for Poller timer to successfully run on the RunLoop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjamin-es-hall Thank you! I think it looks sensible, but how will this affect the minimum version of Unleash? In the past we changed away from the usage of ObservableObject on the base in order to support iOS 12. See #34
No problem! Oh I didn't notice In that case, the async methods I've put in Would you also be able to explain why ObservableObject is used? It's use case is not clear to me without an example since any changes seem to be propagated via the swiftEventBus and notification center anyway? |
@FredrikOseberg just pushed up a commit to move the methods to the UnleashClient class where it already specifies iOS13 requirement |
Observable object was initially used to allow UI changes to propagate automatically when a feature flag updated. Without it, from my understanding, you'll have to trigger the UI update manually yourself. This was done to keep consistency with how our other client side SDKs handle flag changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
About the changes
This adds async overloads for the start and updateContext methods so that they can safely be called from async context in modern swift concurrency. MainActor requirement is needed for the timer within the Poller to fire on the RunLoop.
Fairly sure this should close #88
Closes #88
Important files
Discussion points