Open
Description
@snyamathi @lingyan @pablopalacios
Goal
Make the API more intuitive and easy to use for developers
Background
Some of this work is based on the discussion in #263 (comment)
Proposals
Simplify CRUD signatures
- Remove method chaining and just pass an options object with everything that is needed inside. It would be easy to mock and would make it clear which options are being passed (and wouldn't require unnecessary typing as the
end
call or the doublenull
). - Remove
callback
interface - Remove
end()
method
Current:
fetchr.read('resource', params, { timeout: 500 });
fetchr.create('resource', params, body, { timeout: 500 });
Proposal:
fetchr.read({
resource: 'foo',
params: Object,
// additional options
cors?: Boolean,
constructGetUri?: Function
retry?: Object,
timeout?: Number
unsafeAllowRetry?: Boolean,
});
fetchr.create({
resource: 'foo',
params: Object,
body: Object,
// additional options
cors?: Boolean,
constructGetUri?: Function
retry?: Object,
timeout?: Number
unsafeAllowRetry?: Boolean,
});
Metadata
Metadata
Assignees
Labels
No labels