dsbridge-async

Async version of DSBridge

Usage no npm install needed!

<script type="module">
  import dsbridgeAsync from 'https://cdn.skypack.dev/dsbridge-async';
</script>

README

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);
};