spree-api-v2-js-sdk icon indicating copy to clipboard operation
spree-api-v2-js-sdk copied to clipboard

Extend Http base class with config interface and add optional chaining to the Client

Open letelete opened this issue 3 years ago • 0 comments

This PR is a proposal for implementing fluent interface experience provided by the SDK.

Chained methods (withLocale) are optional, don't break usage of the SDK, and are backward compatible.

Moreover, a configuration can be overridden on endpoint calls by passing particular params (eg. locale).

This proposal suggests a base PoC for refactoring the SDK and enabling the user to provide initial configuration on the makeClient function call level such as Bearer token, Currency, and more...

letelete avatar Aug 18 '22 11:08 letelete