tgvashworth / fetch-engine

A smart request-making library
24 stars 6 forks source link

Make fetchGroup({ ... }) factory #83

Closed tgvashworth closed 6 years ago

tgvashworth commented 8 years ago

To support state in groups of plugins, there should a fetchGroup factory method that allows deferring group creating until instantiation:

const CoolGroup = fetchGroup(() => ({
  filters: [ ... ],
  plugins: [ ... ]
});

const fetch = fetchEngine({
  plugins: [ new CoolGroup() ]
});