Skip to content

Commit

Permalink
Update lib/server/undo_server_observer_behaviour.ex
Browse files Browse the repository at this point in the history
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
  • Loading branch information
cortfritz and coderabbitai[bot] authored Nov 28, 2024
1 parent c49e4dd commit 2acb723
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/server/undo_server_observer_behaviour.ex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ defmodule Yex.UndoServer.ObserverBehavior do
stack items during undo/redo operations.
"""

@doc """
Called when a new item is about to be added to the undo stack.
## Parameters
- stack_item: A map containing the undo operation details
## Returns
- `{:ok, modified_item}` to add the possibly modified item to the stack
- `:ignore` to prevent the item from being added to the stack
"""
@callback handle_stack_item_added(stack_item :: map()) :: {:ok, map()} | :ignore

@doc """
Called after an item has been popped from the undo stack during undo/redo operations.
## Returns
- `:ok` to acknowledge the pop operation
"""
@callback handle_stack_item_popped() :: :ok
end

0 comments on commit 2acb723

Please sign in to comment.