Before this refactor, the Resource class was responsible for some of the networking logic. After it, this responsibility is split into a NetworkClient class (shared by all resources) and a TransformingNetworkClient (one for each resource).
This simplifies both the Resource class and the createMollieClient.ts module.
The Resource (base)class is now a candidate for removal. It only contains the injectPaginationHelpers helper function. The ParentedResource (base)class is candidate for removal as well, as it only exists to facilitate withParent (which has been deprecated since 2.0.0).
Before this refactor, the
Resource
class was responsible for some of the networking logic. After it, this responsibility is split into aNetworkClient
class (shared by all resources) and aTransformingNetworkClient
(one for each resource).This simplifies both the
Resource
class and thecreateMollieClient.ts
module.The
Resource
(base)class is now a candidate for removal. It only contains theinjectPaginationHelpers
helper function. TheParentedResource
(base)class is candidate for removal as well, as it only exists to facilitatewithParent
(which has been deprecated since 2.0.0).