getditto / safer_ffi

Write safer FFI code in Rust without polluting it with unsafe code
http://getditto.github.io/safer_ffi
MIT License
925 stars 40 forks source link

[js] Add `AdhocToReprNapi` #85

Closed danielhenrymantilla closed 2 years ago

danielhenrymantilla commented 2 years ago

This adds a AdhocToReprNapi(|js_env| Ok({ … })) convenience constructor, much alike iter::from_fn for iterators, to easily write ad-hoc ReprNapi implementors, especially useful for JsPromises that need to perform some js-specific post-cleanup logic.