Skip to content
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(replay_bloc): expose List<State> from ReplayBloc/ReplayCubit similar to ReplaySubject #3810

Open
narcodico opened this issue May 8, 2023 · 0 comments
Labels
enhancement candidate Candidate for enhancement but additional research is needed pkg:replay_bloc This issue is related to the replay_bloc package

Comments

@narcodico
Copy link
Contributor

Description

Please consider exposing a List<State> from ReplayBloc/ReplayCubit similar to ReplaySubject. This would allow for easy access to previous limit number of states.

Desired Solution

I would like to have handy access to previous states without having to manually cache them. Also you could allow specifying no of steps to undo/redo, e.g.: undo([int steps = 1]). Maybe even using an index, e.g.: undoToIndex(int index) which could be helpful to reset say a HydratedBloc used in conjuncture with a ReplayBloc to initial state at any given point with undoToIndex(0).
Might be some value to also allowing undoTo(State state) even though a state could be directly emitted.

Alternatives Considered

Manually caching states, which is not scalable/reusable.

@felangel felangel added enhancement candidate Candidate for enhancement but additional research is needed pkg:replay_bloc This issue is related to the replay_bloc package labels Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement candidate Candidate for enhancement but additional research is needed pkg:replay_bloc This issue is related to the replay_bloc package
Projects
None yet
Development

No branches or pull requests

2 participants