Replies: 1 comment
-
The endpoints are not (yet) sharing context with the frontend and its state. While I haven't yet tried it out myself, you can probably hack something together by using a Reflex Middleware
Now in your endpoint functions you can access Again, I haven't built that myself yet. But I imagine that by implementing some frontend side polling you may also be able to return some state that was set by your endpoint function. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm curious what the intended method for interacting with State from an external process is in Reflex. I can setup an application with something like this:
In this application, we have a variable 'example_integer' within ExampleState that we want to be able to get and set externally. However, the two patterns I've tried (commented out above) yield unexpected results. The GET returns an rx.Var object while the SET seems to fail silently -- the value doesn't change in the main application and when I print the returned and changed value, it also gives an rx.Var object. The rx.Var object doesn't seem to have an obvious way to see the actual value of the Var.
Is there a better way within Reflex to enable the modification and retrieval of State from outside the application, ideally by adding API Routers? Thanks in advance!
There's some overlap with this discussion but unfortunately it didn't solve my question.
Beta Was this translation helpful? Give feedback.
All reactions