I use hanami/interactor now with hanami v1, but I found hanami/interactor was removed from hanami v2.
Does Anyone know why hanami/interactor was removed?
And how we should change the old interactor? (For example we think we’ll change expose to attr_reader and error! method to raise. Is it the right way in hanami v2? ref: Module: Hanami::Interactor — Hanami API docs | v1.3.3)
There’s no official replacement and we’re still thinking what to do with this. Having a “blessed” solution like this is tricky because it’s not really possible to come up with something generic enough for most people to be happy with. I started experimenting with a library similar to dry-transaction lately and maybe something will come out of it.
In general, you can use whatever you prefer, plenty of existing options are out there. If you’re happy with the interactors you could port them to work with Hanami 2.0, it does not make any assumptions about this type of libraries so really, no limits here.
Because we keep the code simple and not too dependent on framework, we’ll use simple class , like pure ruby object (We don’t use expose method but attr_reader, and don’t use error! method but raise) as Interactor.