-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Requiring users to remove listeners in onDestroy is sub-optimal now that lifecycle-aware observer is a thing.
There are two approaches:
- Use lifecycle observer and remove the listener upon
onDestroy- Pros
- Less internal state is android-aware
- Cons
- Basically duplicating
LiveData's functionality
- Basically duplicating
- Pros
- Expose e.g. session state as
LiveData<SessionState>- Pros
- Less work. Just works™
- Cons
- The internal state is lifecycle aware by default. Or, we can make authgear core listen to itself and dispatch
stateLiveData.value = stateinonSessionStateChangedto make it fully modular
- The internal state is lifecycle aware by default. Or, we can make authgear core listen to itself and dispatch
- Pros
Must:
- Existing listener-based API must remain so that android apps which have not yet adopted lifecycle can still use the SDK
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request