Replies: 2 comments
-
Would it be more consistent to extend the custom const TodoResource = createResource({
schema: Todo,
endpoints: {
current: {
path: '/todo',
// schema: Todo <-- implicitly extends parent's values.
}
},
}) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Final solution in #2715 |
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
-
Adding
endpoints
option tocreateResource
.This is a specialization that reduces the verbosity of the common case of simple endpoint customizations, additional endpoints, or excluding default endpoints.
Before
After
Design choices
We chose a named option vs second arg mainly due to the way formatters behave (prettier) making it way too indented. This also has the advantage of easily allowing further customizations by different names
Credits
@Dav3rs
Beta Was this translation helpful? Give feedback.
All reactions