normalize (typeClass, hash, prop) Object
Normalize the record and recursively normalize/extract all the embedded records while pushing them into the store as they are encountered
A payload with an attr configured for embedded records needs to be extracted:
{
"post": {
"id": "1"
"title": "Rails is omakase",
"comments": [{
"id": "1",
"body": "Rails is unagi"
}, {
"id": "2",
"body": "Omakase O_o"
}]
}
}
Parameters:
-
typeClass
DS.Model -
hash
Object - to be normalized
-
prop
String - the hash has been referenced by
Returns:
-
Object - the normalized hash
Please login to continue.