Skip to content

Conversation

Lermex
Copy link

@Lermex Lermex commented Apr 16, 2024

Scalajs-react added a feature, called Effect Agnosticism, to support arbitrary effects instead of its own Callback and CallbackTo types. For example, you can use Cats Effect or ZIO.

Unfortunately, when scalajs-react is imported in this mode, the Callback classes are not in the same package so the code generated by the Converter doesn't compile. Even if it did, re-wrapping the effect type that you actually use in Callback is even worse than having to unwrap it into an impure function.

Ideally the Converter would support effect-agnostic scalajs-react as a new flavor, but doing so requires outputting higher-kinded type parameters in various places so it's a bit of an undertaking.

As a more immediate solution this PR just adds an option to disable the wrapping of callback-style props in the Callback type so the user could manually unwrap their effect type into impure functions but keep using all the other facilities of the ScalajsReact flavor.

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

Successfully merging this pull request may close these issues.

1 participant