joystick icon indicating copy to clipboard operation
joystick copied to clipboard

Add a way to copy fetched data to state

Open rglover opened this issue 2 years ago • 1 comments

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 avatar Dec 06 '23 23:12 rglover

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).

rglover avatar Feb 08 '24 09:02 rglover