1.0.0 • Published 5 years ago

dsbridge-async v1.0.0

Weekly downloads
6
License
-
Repository
github
Last release
5 years ago

DSBridge-Async

On top of dsbridge, added callAsync() to promisify call().

All native dsbridge functions are exported without any changes:

  • call()
  • register()
  • registerAsyn()
  • hasNativeMethod()
  • disableJavascriptDialogBlock()

Install

npm i dsbridge-async

Usage

import dsbridge from "dsbridge-async";

// instead of passing callback, callAsync will return a promise
const task = async () => {
  const res = await dsbridge.callAsync("method-name", someArgs);
  console.log(res);
};