Function nj_core::create_promise

source ·
pub fn create_promise<F, O>(
    js_env: &JsEnv,
    name: &str,
    future: F
) -> Result<napi_value, NjError>where
    F: Future<Output = O> + 'static + Send,
    O: TryIntoJs,
Expand description

create promise and schedule work when this is finished it will return result in the main thread