Documentation / @ember-data/legacy-compat / index / normalize
ts
function normalize(
this,
modelName,
payload): SingleResourceDocument<string>;
Defined in: warp-drive-packages/legacy/declarations/compat.d.ts:75
normalize
converts a json payload into the normalized form that push expects.
Example
js
socket.on('message', function(message) {
let modelName = message.model;
let data = message.data;
store.push(store.normalize(modelName, data));
});
Parameters
this
modelName
string
The name of the model type for this payload
payload
Returns
SingleResourceDocument
<string
>
The normalized payload