Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redux-resource-fetch #276

Open
jamesplease opened this issue Dec 7, 2017 · 1 comment
Open

redux-resource-fetch #276

jamesplease opened this issue Dec 7, 2017 · 1 comment
Labels
ecosystem extra This relates to something in the Redux Resource ecosystem, and not the core library

Comments

@jamesplease
Copy link
Owner

jamesplease commented Dec 7, 2017

Assuming #275 isn't closed in favor of #250, I should figure out the API for redux-resource-fetch, making the assumption that AbortController is supported.

The popular GitHub fetch polyfill may soon support this: JakeChampion/fetch#547


One possibility based on #275 :

// There is now only one method!
// The first argument determines which CRUD action it is
crudRequest('read', {
  url: '/pasta/pls',

  // These are options to configure the XHR request
  fetchOptions: {
    credentials: 'include',
    signal: abortController.signal
  },

  // These are properties that are merged into the start and end action by default
  actionProperties: {
    resourceName: 'books',
    mergeMeta: false
  },

  // same as what exists today
  transformData(data) {
   return body.data;
  }
})
  .then(
    (action, body) => dispatch(action)
    (action, err) => dispatch(action)
  );
@jamesplease jamesplease added ecosystem extra This relates to something in the Redux Resource ecosystem, and not the core library revisit I plan to resolve this, but not right now labels Dec 7, 2017
@jamesplease
Copy link
Owner Author

I'm going to close this as revisit. I'll open it when/if the abort polyfill lands.

@jamesplease jamesplease reopened this Jul 14, 2018
@jamesplease jamesplease removed the revisit I plan to resolve this, but not right now label Jul 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ecosystem extra This relates to something in the Redux Resource ecosystem, and not the core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant