reflex
reflex copied to clipboard
Updating State Outside of Event Handlers?
I am testing pynecone by making a very basic small tool that wraps a CLI utility. I call sh.tool(arg, _bg=True, _out=State.update_cmd_stdout) in my index function to use the sh library to execute tool with arg, background the process, and have the library call the State.update_cmd_stdout method as a callback per line of stdout received. However, the callback function, an event handler on the state object, does not seem to be invoked. Is it possible to directly call state handler functions, or can they only be called by the framework internally based on trigger events?