Versent / redux-crud

A set of standard actions and reducers for Redux CRUD Applications
MIT License
624 stars 54 forks source link

How to fetch a single record #53

Open koshuang opened 7 years ago

koshuang commented 7 years ago

Hi,

In my case I would like to just fetch a single record like what we are using RESTful API like GET /users/1.

How should I do if I want to use redux-crud to meet my goal?

jsherbert commented 7 years ago

As I see it redux-crud is concerned with managing data once it has arrived in your app. It has no opinions whatever about how that data gets there - from an API, user input, etc.

An example in the docs gives code demonstrating how you might handle the data from an API call.

I feel like there's definitely room for a library that integrates with redux-crud to handle API calls; I've written one for a side project but I worry that it bakes in too many blithe or just plain bad assumptions to be useful to anybody else! 😭