Closed justincy closed 7 years ago
This would also help standardize response and error handling.
iron-ajax supports multiple outstanding AJAX requests. I don't believe we need to allow multiple requests in that we support a component fetch two different entities, but we do need to support autocomplete for fs-date and fs-place which can include many requests fired in close succession.
Features:
Example:
<fs-request url="{{computeUrl(personId)}}" on-response="{{handleResponse}}"></fs-request>
computeUrl(personId) {
return `/platform/tree/persons/${personId}`;
}
Most components need to load data from the API. We already have fs-behavior which helps with this by making it easy to access the SDK client. Perhaps we should augment to help with other common tasks such as tracking loading status.
Perhaps we need our own version of iron-ajax. Then, instead of using a behavior or mixin which is all or nothing, components can choose, via data binding and other integration points, how much of the behavior they get. It would replace most instances of fs-client.
fs-ajax or fs-request?