Closed williamviktorsson closed 2 months ago
So do I just use this?
<Action focused={() => console.log("Focused")} />
It does not seem to get logged at all.
I'm on:
"svelte": "5.0.0-next.167",
"@animotion/core": "^1.0.15",
@williamviktorsson Was the whole point of the issue btw so that you don't need to do this?
<Action
do={() => {
console.log("Apply state change");
}}
undo={() => {
console.log("Apply state change");
}}
/>
Why not just do this?
<script>
function handleFocus() {
console.log("Apply state change");
}
</script>
<Action
do={handleFocus}
undo={handleFocus}
/>
I also don't get why undo
had to be removed.
I have custom animations that tie in the events of
do
undo
@Blankeos it makes more sense it's the default behavior for do
so you don't have to repeat yourself so undo
for that reason is redundant
I've found that I'd like to reapply the state change in a
do
callback when traversing backwards, and I'd like to not duplicate this code in followingundo
callbacks to achieve this.I propose that when an item is focused (the last Action/Transaction), there's a callback that is performed no matter what way the presentation is navigated.