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

Add a way to copy fetched data to state #368

Open
rglover opened this issue Dec 6, 2023 · 1 comment
Open

Add a way to copy fetched data to state #368

rglover opened this issue Dec 6, 2023 · 1 comment
Assignees
Labels
feature Something new to add @joystick.js/ui Related to the @joystick.js/ui package.
Projects

Comments

@rglover
Copy link
Contributor

rglover commented Dec 6, 2023

This comes up fairly often. There are situations with forms where data fetched from the server needs to be popped on to state. It'd be helpful to have a flag on a getter's options to say set_on_state. That would allow whatever we get back from the data function to just be placed on to state (and updated on refetch) automatically.

@rglover rglover added feature Something new to add @joystick.js/ui Related to the @joystick.js/ui package. labels Dec 6, 2023
@rglover rglover self-assigned this Dec 6, 2023
@rglover
Copy link
Contributor Author

rglover commented Feb 8, 2024

Consider the option being set_on_state_as where the value is the name of the state variable (e.g, set_on_state_as: 'books' copies the value to state.books).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Something new to add @joystick.js/ui Related to the @joystick.js/ui package.
Projects
1.x.x
Awaiting triage
Development

No branches or pull requests

1 participant