You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.
Is your feature request related to a problem? Please describe.
I think that it is
not obvious from looking at code that path="string" will be appended to the path(s) of parent <Get>(s)
not safe to assume that components will only make requests that fit with the nesting of paths
Describe the solution you'd like
I propose to update the API so that
<Get path="/persian"> // makes a request to /persian
<Get path={(parentPaths: string[]) => `${parentPath.join("/")}/persian`} > // makes a request to /cats/persian
where parentPaths is an array of the normalized paths (stripped of trailing /) of the parent <Get>s.
Describe alternatives you've considered
parentPaths could also be a string of the concatenated parent paths. I believe however that the use of an array is more flexible if we go with nested <Get>s affecting each other.
Alternatively or additionally we could introduce a <Path> component that affects the nesting while <Get>s don't affect each other's path at all. This would allow us to do things like this, too:
Typically, components that nest also map to nested resources, hence the current design. I could also make the docs a little bit clearer about that API.
I think if we decide to implement your feature request, it'll have to be an add instead of a modify, which will be backwards compatible. So specced out, path could be a string, in which case it nests, or a function in which case it works the way you require. I'm still fairly unclear about the use case/need it'll be meeting.
From your second considered alternative, the <Path /> component, the only way its children would have access to the path from the Path component in that case is via function children. Your sample would actually look like
Is your feature request related to a problem? Please describe.
I think that it is
path="string"
will be appended to the path(s) of parent<Get>
(s)Describe the solution you'd like
I propose to update the API so that
where
parentPaths
is an array of the normalizedpath
s (stripped of trailing/
) of the parent<Get>
s.Describe alternatives you've considered
parentPaths
could also be a string of the concatenated parent paths. I believe however that the use of an array is more flexible if we go with nested<Get>
s affecting each other.<Path>
component that affects the nesting while<Get>
s don't affect each other's path at all. This would allow us to do things like this, too:The text was updated successfully, but these errors were encountered: