UNPKG

@fruits-chain/react-native-xiaoshu

Version:
25 lines (24 loc) • 647 B
"use strict"; import React from 'react'; import Portal from "../portal/index.js"; import SelectorMethod from "./selector-method.js"; import { jsx as _jsx } from "react/jsx-runtime"; const SelectorInstance = opt => new Promise((resolve, reject) => { const key = Portal.add(/*#__PURE__*/_jsx(SelectorMethod, { ...opt, onChange: (v, o) => { opt.onChange?.(v, o); resolve(v); }, onClose: () => { opt.onClose?.(); reject(new Error()); }, onClosed: () => { opt.onClosed?.(); Portal.remove(key); } })); }); export default SelectorInstance; //# sourceMappingURL=selector-instance.js.map