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 option to disable wrapping scalajs-react props in Callback #620

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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