starfederation / datastar

A real-time hypermedia framework.
https://data-star.dev/
MIT License
707 stars 40 forks source link

sending a partial store to the backend. #199

Closed jmarkleyrepay closed 3 weeks ago

jmarkleyrepay commented 3 weeks ago

hey, here's a scenario I want to ponder with you all.

Lets say you have multiple api calls so you have a struct that may look like the below in a store.

{fooData: [...], barData: {...}, view: "someView"}

When I go to do a PUT or a POST the entire store is sent, is there a way to send just fooData or barData instead of the entire store?

delaneyj commented 3 weeks ago

if you prefix a key with _ it will get treated as a local signal. @bencroker we need to add this to the backend reference docs.

bencroker commented 3 weeks ago

No, the entire store is sent. Shouldn't matter though, because the backend can decide what to do with it, and nested store values can help too.

bencroker commented 3 weeks ago

Ah yes, forgot about the underscore, but otherwise there's no way to specify a few store values to send and a few to exclude.

jmarkleyrepay commented 3 weeks ago

makes sense, thanks y'all.