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

Add before_inline_transition_to callback #5

Open
svanhesteren opened this issue Oct 29, 2024 · 3 comments
Open

Add before_inline_transition_to callback #5

svanhesteren opened this issue Oct 29, 2024 · 3 comments

Comments

@svanhesteren
Copy link
Contributor

Currently we can only specify an after callback. But sometimes you want to perfom some actions before the state is transitioned.
Atm we do not have this possibility so a before_inline_transition_to would be handy to have.

@julik
Copy link
Collaborator

julik commented Oct 30, 2024

That would be nice - but should that "before..." also be able to abort the transition? I didn't want to decide on that so that's why I haven't implemented it initially.

@svanhesteren
Copy link
Contributor Author

I think yes. Atm I need it to be in a transaction block that rolls back when something fails. But maybe you can pass in an option.

@julik
Copy link
Collaborator

julik commented Oct 30, 2024

Well, if it raises it will anyway abort whatever is happening. But should it work like a callback - and be able to abort the transaction by returning a falsey value from the block? I would prefer to avoid that as creating an implicit block return with a falsy value can easily make the entire action "silently" abort, which is not ideal. Maybe we should actually state that "no, you can't manage the transition from the block except for when your block raises"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants