Comments (2)
I looked at doing a PR to add a deferral option for events but when investigating the relevant code realized the fact the code executes a singular event at a time and with the locks there wouldn't be a easy way for background handlers. Including even if holding onto the relevant info for afterwards (and either allowing the user to take a deferral or having a binding the user specifies they would always set the result when finished). While one could do those things, given the one event at a time until a result is returned would eliminate the benefits.
This isn't a huge deal for the .net library we can add our own bind function and relevant JS code and just handle the magic in JS land while allowing async actions in .net as well. Once we have a sample will post it back.
As a minor side note I assumed above that the normal bind (non interface) calls were properly binding functions into the global namespace in JS but they don't either.
from webui.
I believe the wrapper interface (webui_interface_*) is to make it a bit easier
than the non-interface ones
Yes, webui_interface_xxx
functions are simply a wrapper of webui APIs in a simplified format to make things easier for wrappers.
sounds like webui_bind when called with the ID of something not in the DOM
registers the function to webui.call("FuncName")
This is in purpose, if the user do webui_bind("Foo")
, it does not mean there is a DOM object called Foo
, but simply he wants to make webui.call("Foo")
available, therefor, webui will create Foo
object, so Foo()
will be available globally.
Calling the interface version does not though
there we only see bound functions from webui.call("*")
Can you please clarify more this section?
It does almost require callback interop though
so it isn't as if supporting some level of async wouldn't be possible
Do you mean webui.call('ID') . then ((response) => { ... });
determining how many args we actually get called
Good idea, we should add this option.
expanding from click events to any eventListener event
Can you please clarify more this section?
executes a singular event at a time and with the locks
The old versions of webui does not use locks, so all UI events gets fired right away, but this caused many wrappers to crash, like the V wrapper for example. Also makes webui.call()
start to miss some events when it get called quickly, like 100 times per second (every 10ms)... so, adding locks, and fire one event at a time solved all those issues. But I see your point, probably we should add an option to make events fired simultaneously, this can be handy for some projects.
binding functions into the global namespace in JS but they don't either
Normally, webui_bind("Bar")
will create a DOM object in global namespace window
, and it can be used simply by Bar();
.
from webui.
Related Issues (20)
- How to create an Android app? HOT 1
- OpenSSL doesn't work in Firefox and Safari HOT 7
- Build failed using WEBUI_USE_TLS option using windows mingw HOT 7
- Deno's example should update HOT 1
- Edge Browser window won't show up when running as SYSTEM account in Windows HOT 3
- When h5 website is run, a white screen appears randomly and the program exits automatically HOT 13
- Can the webui_set_file_handler serve the image files or other type? HOT 3
- Question: Usecase of WebUI HOT 2
- webui_close is useless HOT 3
- How to unbind an event? HOT 6
- Floats HOT 5
- Cannot use WebUI versions > 2.4.1 for V wrapper HOT 8
- add cmake cross build
- Can't run example HOT 3
- Errors compiling minimal example: "undefined reference to pthread_create" and "undefined reference to `dlopen'" (and my fixes) HOT 5
- `set_title` function HOT 3
- `webui_set_root_folder` is broken HOT 3
- Regession with the latest changes HOT 6
- set_profile & CORS HOT 9
- SvelteKit + webui problem HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webui.