How to use the rax-use-promise function in rax-use-promise

To help you get started, we’ve selected a few rax-use-promise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / rax / packages / rax-use-import / src / index.js View on Github external
export default function useImport(create, args) {
  let [mod, error] = usePromise(
    useMemo(create, [args])
  );

  if (mod) {
    mod = mod.__esModule ? mod.default : mod;
  }

  return [mod, error];
}

rax-use-promise

Rax usePromise hook

BSD-3-Clause
Latest version published 6 years ago

Package Health Score

53 / 100
Full package analysis

Popular rax-use-promise functions