reflex icon indicating copy to clipboard operation
reflex copied to clipboard

Updating State Outside of Event Handlers?

Open pb376 opened this issue 2 years ago β€’ 0 comments

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?

pb376 avatar Mar 15 '23 09:03 pb376