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

Provide generic module helpers and document strategies of module encoding #3

Open
paluh opened this issue Jul 30, 2022 · 0 comments
Open

Comments

@paluh
Copy link
Member

paluh commented Jul 30, 2022

Encoding for JS modules

  • Use Record to represent modules which does not expose mutable properties or you don't want to expose them.

  • Use JSObject to expose mutable properties by using Prop.

  • Type module level functions as EffectFn* in both cases.

  • Type constructor functions as ConstructorFn* in both cases.

Generic helpers

It seems that we can help generate records from both representations which gonna handle ConstructorFn* for us properly by turning it into plain effectful function which returns already preprocessed JSObject representation (mkFFI and mkNewtypedFFI).

@paluh paluh changed the title Provide generic module helpers and document them with module encoding Provide generic module helpers and document strategies of module encoding Jul 30, 2022
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

1 participant