You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current SpellcheckerWasm implementation is a bit confusing to use from JS, given that the constructor takes a callback function and there's no obvious way to get at the results outside of the callback or even to match up each result to its corresponding input. I get that it's due to how JS interacts with WASM, but it feels like an implementation detail that should be hidden from library consumers.
Also, given that callbacks are often used for async functionality, a reasonable (but incorrect) assumption would be that the callback is called asynchronously.
A more intuitive API could be achieved something like this:
Perhaps this could be incorporated into SpellcheckerWasm's public API, with direct calling of checkSpelling etc either made private (breaking change) or deprecated?
The text was updated successfully, but these errors were encountered:
The current
SpellcheckerWasm
implementation is a bit confusing to use from JS, given that the constructor takes a callback function and there's no obvious way to get at the results outside of the callback or even to match up each result to its corresponding input. I get that it's due to how JS interacts with WASM, but it feels like an implementation detail that should be hidden from library consumers.Also, given that callbacks are often used for async functionality, a reasonable (but incorrect) assumption would be that the callback is called asynchronously.
A more intuitive API could be achieved something like this:
Perhaps this could be incorporated into
SpellcheckerWasm
's public API, with direct calling ofcheckSpelling
etc either made private (breaking change) or deprecated?The text was updated successfully, but these errors were encountered: