Skip to content

Instantly share code, notes, and snippets.

@sverhoeven
Created October 2, 2020 09:16
Show Gist options
  • Save sverhoeven/20bc9f7322cc27f5242e245beba38c45 to your computer and use it in GitHub Desktop.
Save sverhoeven/20bc9f7322cc27f5242e245beba38c45 to your computer and use it in GitHub Desktop.
run-cpp-on-web: react
function handleSubmit(event) {
event.preventDefault();
// Wait for module to initialize,
createModule().then(({NewtonRaphson}) => {
// Perform computation
const newtonraphson = new NewtonRaphson(tolerance);
const root = newtonraphson.solve(initial_guess);
setRoot(root);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment