Skip to content
This repository was archived by the owner on Mar 3, 2024. It is now read-only.

Commit 16d11db

Browse files
committed
Refactoring code
1 parent 5b90702 commit 16d11db

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

example/app/Entry.js

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,9 @@ class Entry extends Component {
144144
advertiseMode: BLEAdvertiser.ADVERTISE_MODE_LOW_POWER,
145145
txPowerLevel: BLEAdvertiser.ADVERTISE_TX_POWER_ULTRA_LOW,
146146
connectable: false,
147-
includeDeviceName: false, includeTxPowerLevel: false
148-
})
149-
.then((sucess) => {
150-
console.log(this.state.uuid, "Adv Successful", sucess);
151-
}).catch(error => {
152-
console.log(this.state.uuid, "Adv Error", error);
153-
});
147+
includeDeviceName: false, includeTxPowerLevel: false })
148+
.then(sucess => console.log(this.state.uuid, "Adv Successful", sucess))
149+
.catch(error => console.log(this.state.uuid, "Adv Error", error));
154150

155151
console.log(this.state.uuid, "Starting Scanner");
156152
// Manuf Data [1,0,0,0] picks up iPhones
@@ -169,19 +165,13 @@ class Entry extends Component {
169165
stop(){
170166
console.log(this.state.uuid, "Stopping Broadcast");
171167
BLEAdvertiser.stopBroadcast()
172-
.then((sucess) => {
173-
console.log(this.state.uuid, "Stop Broadcast Successful", sucess);
174-
}).catch(error => {
175-
console.log(this.state.uuid, "Stop Broadcast Error", error);
176-
});
168+
.then(sucess => console.log(this.state.uuid, "Stop Broadcast Successful", sucess))
169+
.catch(error => console.log(this.state.uuid, "Stop Broadcast Error", error));
177170

178171
console.log(this.state.uuid, "Stopping Scanning");
179172
BLEAdvertiser.stopScan()
180-
.then((sucess) => {
181-
console.log(this.state.uuid, "Stop Scan Successful", sucess);
182-
}).catch(error => {
183-
console.log(this.state.uuid, "Stop Scan Error", error);
184-
});
173+
.then(sucess => console.log(this.state.uuid, "Stop Scan Successful", sucess) )
174+
.catch(error => console.log(this.state.uuid, "Stop Scan Error", error) );
185175

186176
this.setState({
187177
isLogging: false,

0 commit comments

Comments
 (0)