Skip to content
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

[REF-2287] Redis fetches the same state multiple times #2950

Closed
masenf opened this issue Mar 28, 2024 · 0 comments · Fixed by #4055
Closed

[REF-2287] Redis fetches the same state multiple times #2950

masenf opened this issue Mar 28, 2024 · 0 comments · Fixed by #4055
Assignees
Labels
bug Something isn't working
Milestone

Comments

@masenf
Copy link
Collaborator

masenf commented Mar 28, 2024

It's possible for a single state to be fetched from redis multiple times.

import reflex as rx


class State(rx.State):
    pass


class S2(State):
    @rx.var
    def foo(self):
        return "foo"


class S3(S2):
    def handler(self):
        print("foo")


def index():
    return rx.button("Click", on_click=S3.handler)


app = rx.App()
app.add_page(index)

This will load S2 from redis twice

Work branch: masenf/optimize-redis-get-state

From SyncLinear.com | REF-2287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants