本文整理汇总了TypeScript中basil.js.default.set方法的典型用法代码示例。如果您正苦于以下问题:TypeScript js.default.set方法的具体用法?TypeScript js.default.set怎么用?TypeScript js.default.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类basil.js.default
的用法示例。
在下文中一共展示了js.default.set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: remove
remove: (scan: BluetoothlePlugin.ScanParams) => {
const scans = result.fetch();
remove(
scans,
(scana: BluetoothlePlugin.ScanParams) => scana.name === scan.name
);
store.set(KEY, scans);
},
示例2: remove
remove: (ch: BluetoothlePlugin.Characteristic) => {
const chs = result.fetch();
remove(
chs,
(snip: BluetoothlePlugin.Characteristic) => snip.uuid === ch.uuid
);
store.set(KEY, chs);
},
示例3: remove
remove: (periph: Params.peripheral) => {
const periphs = result.fetch();
remove(
periphs,
(peripha: Params.peripheral) => peripha.name === periph.name
);
store.set(KEY, periphs);
},
示例4: remove
remove: (adv: BluetoothlePlugin.AdvertisingParamsAndroid) => {
const advs = result.fetch();
remove(
advs,
(advert: BluetoothlePlugin.AdvertisingParamsAndroid) =>
advert.service === adv.service
);
store.set(KEY);
},
示例5:
update: (adv: BluetoothlePlugin.AdvertisingParamsAndroid) => {
if (adv.uuid === "") return;
const advs = result.fetch();
const found = result.find(adv.uuid);
if (!found) {
advs.push(adv);
} else {
advs[result.getIndex(adv)] = adv;
}
store.set(KEY, advs);
},
示例6:
update: (scan: BluetoothlePlugin.ScanParams) => {
if (scan.name === "") return;
const scans = result.fetch();
const found = result.find(scan.name);
if (!found) {
scans.push(scan);
} else {
const index = result.getIndex(scan);
scans[index] = scan;
}
store.set(KEY, scans);
},
示例7:
update: (svc: Params.initService) => {
if (svc.service === "") return;
const svcs = result.fetch();
const found = result.find(svc.service);
if (!found) {
svcs.push(svc);
} else {
const index = result.getIndex(svc);
svcs[index] = svc;
}
store.set(KEY, svcs);
},
示例8:
update: (periph: Params.peripheral) => {
if (periph.name === "") return;
const periphs = result.fetch();
const found = result.find(periph.name);
if (!found) {
periphs.push(periph);
} else {
const index = result.getIndex(periph);
periphs[index] = periph;
}
store.set(KEY, periphs);
},
示例9:
update: (ch: BluetoothlePlugin.Characteristic) => {
if (ch.uuid === "") return;
const chs = result.fetch();
const found = result.find(ch.uuid);
console.log("found", found);
console.log(chs);
if (!found) {
chs.push(ch);
} else {
chs[result.getIndex(ch)] = ch;
}
store.set(KEY, chs);
},