GithubHelp home page GithubHelp logo

Comments (1)

runspired avatar runspired commented on June 12, 2024

when you use store.request instead of requestManager.request this is automatically done. the result will have a content property that is the json-api document, and its data property will be the record instance.

We make a note of this a few places (for instance under architecture here https://api.emberjs.com/ember-data/5.3/modules/@ember-data%2Frequest and under the main store overview here

* ### Presenting Data from the Cache
*
* Now that we have a source and a cach for our data, we need to configure how
* the Store delivers that data back to our application. We do this via the hook
* [instantiateRecord](https://api.emberjs.com/ember-data/release/classes/Store/methods/instantiateRecord%20(hook)?anchor=instantiateRecord%20(hook)),
* which allows us to transform the data for a resource before handing it to the application.
*
* A naive way to present the data would be to return it as JSON. Typically instead
* this hook will be used to add reactivity and make each unique resource a singleton,
* ensuring that if the cache updates our presented data will reflect the new state.
*
* Below is an example of using the hooks `instantiateRecord` and a `teardownRecord`
* to provide minimal read-only reactive state for simple resources.
) though these spots could be improved and having the api docs for Store.request call this out explicitly would be good.

Note, above 2 should be "2" as in store.request(findrecord('person', '2'));

from data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.