Open whowillcare opened 1 month ago
Hi @whowillcare 👋 Thanks for opening an issue!
Are you able to provide a bit more context around your use-case? ReplayBloc
has a shouldReplay
API which seems like it might be what you're looking for.
The simplest user case would be like: State: list: ['a','b','c'] currentIndex: 0 Event: add: 'd' # add an element to list remove: 'a' # remove 'a' from list Event: select: 1 # select to new index change the currentIndex to 1
So I would like the Undo or Redo events don't need to catch the select event, but still catch the add or remove event, which gives more flexibility by making certain changes are Replay-able, certains are not.
On Tue, Jun 4, 2024 at 1:08 AM Felix Angelov @.***> wrote:
Hi @whowillcare https://github.com/whowillcare 👋 Thanks for opening an issue!
Are you able to provide a bit more context around your use-case? ReplayBloc has a shouldReplay https://pub.dev/documentation/replay_bloc/latest/replay_bloc/ReplayBlocMixin/shouldReplay.html API which seems like it might be what you're looking for.
— Reply to this email directly, view it on GitHub https://github.com/felangel/bloc/issues/4178#issuecomment-2146621416, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABUL3KF6XUGOSIEG4VRIIJLZFVDTJAVCNFSM6AAAAABIFVWRUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBWGYZDCNBRGY . You are receiving this because you were mentioned.Message ID: @.***>
Description
The current solution doesn't have a feature that allow user to specify which events to be added to the changeStack, and which ones are not, which will give user flexiblity to redo or undo specific states changes
Desired Solution
Alternatives Considered
or keep the super.emit to an alternative method name, so the child class can always override the emit method for implementing the similar feature
Additional Context
which will save the resource and allow user to have more flexiblities