-
-
Notifications
You must be signed in to change notification settings - Fork 747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typescript: permit Bangle.setUI({ ... })
with no mode
#2389
Conversation
Do you mean literally just Normally, you should do |
Ah sorry - I think the title may have confused the situation. What I should've said was that we want to allow My intention here is to allow development of wrappers around |
Bangle.setUI({})
Bangle.setUI({ ... })
with no mode
So just to be clear, this is meant to allow this:
If so, I don't believe we should be allowing that. It was never intended behaviour, and isn't documented. I think if you made that call you might rightly assume that the https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/Bangle_setUI_Q3.js I think probably the intended use in that case is |
Yes that makes sense and I agree, an object with no My concern was that if someone writes their own (so less "documented" behaviour and more reflecting what existing apps already do) |
Yes, I see what you mean (if you're implementing setUI). However adding an exception would encourage users (of which there are far more) to think omitting And maybe even make the default I've just fixed |
Sounds good to me, and yeah that's a fair point about not encouraging that invalid use - thanks again. (if you like, I'm happy to submit a patch to |
That would be great, thanks! |
Following on from espruino#2389, this makes it clear that while `setUI()` can be used to reset the UI, `setUI({})` cannot, and must always specify `mode` (amongst other options).
A small typing tweak from espruino/BangleApps#2871