laravel-tactician icon indicating copy to clipboard operation
laravel-tactician copied to clipboard

What about Undo feature?

Open jagarsoft opened this issue 4 years ago • 3 comments

Hi folks What do you think about implementing Undo feature?

Comments will be welcomed!

I have started working on it

jagarsoft avatar Feb 28 '21 01:02 jagarsoft

No comments?

jagarsoft avatar Mar 14 '21 20:03 jagarsoft

hey there, I am not currently using this package too much. So if you think is a good addition you can make a PR and we can take a look. Thanks

joselfonseca avatar Mar 14 '21 21:03 joselfonseca

Thanks @joselfonseca

I made the following assumtions:

  1. "undo"/"redo" methods return the same than their contrapart, "dispatch", did (Memento Pattern)
  2. the array associated with the middleware when invoking the "dispatch" method will walk through in reversed order when you "undo" a command, whilst "redo" a command will process the same middlewares in normal order again
  3. "undo" invokes to "unHandle" method of command and "executeUndo" of middleware. There will be an Inflector Class for them

What do you think? Is it well aligned?

jagarsoft avatar Mar 26 '21 22:03 jagarsoft