Comments (5)
Yeah, so only data
and included
will be handled by redux-json-api, as outlined above.
componentDidMount() {
const response = await this.props.dispatch(readEndpoint('/domains?include=remote_access'));
console.log(response);
}
Try this, you can see that you get an ApiResponse
class instance. From here you can read meta
and links
.
fwiw I'm working on an additional library that will make this a bit easier, but it's out of scope for redux-json-api: https://github.com/redux-json-api/react-redux-json-api
from redux-json-api.
Yes, exactly. await
is just another way to wait for the promise to resolve 🙂
from redux-json-api.
You mean the root links
and meta
properties? They're not automatically populated to redux state, no. The reason is that redux-json-api takes care of storing resources independent of requests, and root.links
, root.meta
are request-specific.
You can easily take care of storing them in whatever way you need, while keeping the benefit of having redux-json-api store your resources:
const tasksResponse = await readEndpoint('/data/tasks');
const responseLinks = tasksResponse.links;
const responseMeta = tasksResponse.meta;
from redux-json-api.
Yes, I mean the root links and meta properties.
I try to include root.links
and root.meta
to state and to props later.
componentDidMount() {
this.props.dispatch(readEndpoint('/domains?include=remote_access'));
}
I will use this data for pagination.
from redux-json-api.
componentDidMount() {
this.props.dispatch(readEndpoint('/domains?include=remote_access'))
.then(r => {
console.log(r.body.links);
console.log(r.body.meta)
});
}
I got access to links
and meta
. Thank you!
from redux-json-api.
Related Issues (20)
- Workwith Immutable.js HOT 1
- Best Practice for 422 or 500 Errors HOT 2
- Could you guys give me an example of using json-redux-api with Axios? HOT 17
- Update hydrateStore doc example
- resource.type vs collection endpoint uris HOT 5
- Add flow-typed
- Update set up configuration page to v2 Standards HOT 8
- Delete resource endpoint appears to use relative pathing HOT 5
- Update state at next readEndpoint HOT 3
- Custom URL construction HOT 11
- Action type is undefined HOT 4
- Pagination URLs can be objects.
- Unable to start expo due to Node standard library dependency of keykey HOT 1
- angular @angular-redux process not defined HOT 6
- babel-runtime must be added manually to build
- Media Types (Content Negotiation) for mutlipart/form-data content type. Request for implementation. HOT 1
- Is there any known live fork of this repo? HOT 2
- getRelatedResources crashes if relationship data is null HOT 2
- Export instance of axios that used in requests
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-json-api.