Skip to content

Commit

Permalink
fix: ci/cd
Browse files Browse the repository at this point in the history
  • Loading branch information
intent-kacper-cyranowski committed Jun 17, 2024
1 parent 7b0e6d3 commit 04a849d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion example/src/services/BLEService/BLEService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class BLEServiceInstance {
onDeviceFound(device)
}
})
.then(() => console.log('scanning'))
.then(() => {})
.catch(console.error)
}

Expand Down
18 changes: 8 additions & 10 deletions src/BleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Device } from './Device'
import { Service } from './Service'
import { Characteristic } from './Characteristic'
import { Descriptor } from './Descriptor'
import { State, LogLevel, type BleErrorCodeMessageMapping, ConnectionPriority } from './TypeDefinition'
import { State, LogLevel, ConnectionPriority } from './TypeDefinition'
import { BleModule, EventEmitter } from './BleModule'
import {
parseBleError,
Expand All @@ -18,6 +18,7 @@ import {
} from './BleError'
import type { NativeDevice, NativeCharacteristic, NativeDescriptor, NativeBleRestoredState } from './BleModule'
import type {
BleErrorCodeMessageMapping,
Subscription,
DeviceId,
Identifier,
Expand Down Expand Up @@ -135,7 +136,7 @@ export class BleManager {
* @returns {Promise<void>} Promise may return an error when the function cannot be called.
* {@link #bleerrorcodebluetoothmanagerdestroyed|BluetoothManagerDestroyed} error code.
*/
destroy = async (): Promise<void> => {
async destroy(): Promise<void> {
const response = await this._callPromise(BleModule.destroyClient())

// Unsubscribe from any subscriptions
Expand Down Expand Up @@ -229,7 +230,7 @@ export class BleManager {
* @param {TransactionId} transactionId Id of pending transactions.
* @returns {Promise<void>}
*/
cancelTransaction(transactionId: TransactionId) {
cancelTransaction(transactionId: TransactionId): Promise<void> {
return this._callPromise(BleModule.cancelTransaction(transactionId))
}

Expand Down Expand Up @@ -271,7 +272,7 @@ export class BleManager {
*
* @returns {Promise<State>} Promise which emits current state of BleManager.
*/
state = (): Promise<$Keys<typeof State>> => {
state(): Promise<$Keys<typeof State>> {
return this._callPromise(BleModule.state())
}

Expand All @@ -292,10 +293,7 @@ export class BleManager {
*
* @returns {Subscription} Subscription on which `remove()` function can be called to unsubscribe.
*/
onStateChange = (
listener: (newState: $Keys<typeof State>) => void,
emitCurrentState: boolean = false
): Subscription => {
onStateChange(listener: (newState: $Keys<typeof State>) => void, emitCurrentState: boolean = false): Subscription {
const subscription: Subscription = this._eventEmitter.addListener(BleModule.StateChangeEvent, listener)
const id = this._nextUniqueID()
var wrappedSubscription: Subscription
Expand Down Expand Up @@ -352,7 +350,7 @@ export class BleManager {
UUIDs: ?Array<UUID>,
options: ?ScanOptions,
listener: (error: ?BleError, scannedDevice: ?Device) => Promise<void>
) {
): Promise<void> {
const scanListener = ([error, nativeDevice]: [?string, ?NativeDevice]) => {
listener(
error ? parseBleError(error, this._errorCodesToMessagesMapping) : null,
Expand All @@ -369,7 +367,7 @@ export class BleManager {
* Stops {@link Device} scan if in progress.
* @returns {Promise<void>} the promise may be rejected if the operation is impossible to perform.
*/
stopDeviceScan = async (): Promise<void> => {
stopDeviceScan(): Promise<void> {
if (this._scanEventSubscription != null) {
this._scanEventSubscription.remove()
this._scanEventSubscription = null
Expand Down

0 comments on commit 04a849d

Please sign in to comment.