@capacitor-community/bluetooth-le
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -1,10 +0,18 @@ | ||
import throat from 'throat'; | ||
const makeQueue = () => { | ||
let currentTask = Promise.resolve(); | ||
// create a new promise so that errors can be bubbled | ||
// up to the caller without being caught by the queue | ||
return (fn) => new Promise((resolve, reject) => { | ||
currentTask = currentTask | ||
.then(() => fn()) | ||
.then(resolve) | ||
.catch(reject); | ||
}); | ||
}; | ||
export function getQueue(enabled) { | ||
if (enabled) { | ||
return throat(1); | ||
return makeQueue(); | ||
} | ||
else { | ||
return (fn) => fn(); | ||
} | ||
return (fn) => fn(); | ||
} | ||
//# sourceMappingURL=queue.js.map |
@@ -6,8 +6,3 @@ 'use strict'; | ||
var core = require('@capacitor/core'); | ||
var throat = require('throat'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var throat__default = /*#__PURE__*/_interopDefaultLegacy(throat); | ||
/** | ||
@@ -133,9 +128,18 @@ * Android scan mode | ||
const makeQueue = () => { | ||
let currentTask = Promise.resolve(); | ||
// create a new promise so that errors can be bubbled | ||
// up to the caller without being caught by the queue | ||
return (fn) => new Promise((resolve, reject) => { | ||
currentTask = currentTask | ||
.then(() => fn()) | ||
.then(resolve) | ||
.catch(reject); | ||
}); | ||
}; | ||
function getQueue(enabled) { | ||
if (enabled) { | ||
return throat__default["default"](1); | ||
return makeQueue(); | ||
} | ||
else { | ||
return (fn) => fn(); | ||
} | ||
return (fn) => fn(); | ||
} | ||
@@ -142,0 +146,0 @@ |
@@ -1,8 +0,4 @@ | ||
var capacitorCommunityBluetoothLe = (function (exports, core, throat) { | ||
var capacitorCommunityBluetoothLe = (function (exports, core) { | ||
'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var throat__default = /*#__PURE__*/_interopDefaultLegacy(throat); | ||
/** | ||
@@ -128,9 +124,18 @@ * Android scan mode | ||
const makeQueue = () => { | ||
let currentTask = Promise.resolve(); | ||
// create a new promise so that errors can be bubbled | ||
// up to the caller without being caught by the queue | ||
return (fn) => new Promise((resolve, reject) => { | ||
currentTask = currentTask | ||
.then(() => fn()) | ||
.then(resolve) | ||
.catch(reject); | ||
}); | ||
}; | ||
function getQueue(enabled) { | ||
if (enabled) { | ||
return throat__default["default"](1); | ||
return makeQueue(); | ||
} | ||
else { | ||
return (fn) => fn(); | ||
} | ||
return (fn) => fn(); | ||
} | ||
@@ -847,3 +852,3 @@ | ||
})({}, capacitorExports, throat); | ||
})({}, capacitorExports); | ||
//# sourceMappingURL=plugin.js.map |
{ | ||
"name": "@capacitor-community/bluetooth-le", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "Capacitor plugin for Bluetooth Low Energy ", | ||
@@ -36,4 +36,3 @@ "main": "dist/plugin.cjs.js", | ||
"dependencies": { | ||
"@types/web-bluetooth": "^0.0.16", | ||
"throat": "^6.0.2" | ||
"@types/web-bluetooth": "^0.0.16" | ||
}, | ||
@@ -40,0 +39,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
617828
2
5201
1075
- Removedthroat@^6.0.2
- Removedthroat@6.0.2(transitive)