Hi all:
In China, miniprogram is very popular and widely used in WeChat, Alipay and other big apps. WeChat miniprogram provide some BLE apis so it's able to connect the lego hub. I want to fork this repo and support the miniprogram environment, If I add the code everywhere like this, it's not pretty:
if (inWeChatMiniProgram) {
wx.startDiscovery(...);
} else {
noble.startDiscovery(...);
}
Any suggestions? What do you think of the code having many types: node, browser, wechat miniprogram, or other environments in future?
Hi all: In China, miniprogram is very popular and widely used in WeChat, Alipay and other big apps. WeChat miniprogram provide some BLE apis so it's able to connect the lego hub. I want to fork this repo and support the miniprogram environment, If I add the code everywhere like this, it's not pretty:
Any suggestions? What do you think of the code having many types: node, browser, wechat miniprogram, or other environments in future?