spree-api-v2-js-sdk
spree-api-v2-js-sdk copied to clipboard
Extend Http base class with config interface and add optional chaining to the Client
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...