There are many hooks in ember data v1.0.0-beta.16.1.
Its just hard to understand the purpose of these hooks. To a novice it seems all of them are meant to do the same thing.
I am looking to understand applications of,
A. normalize and normalizeHash
B. serialize
C. normalizePayload
normalize is used to modify root object in incoming payload. normalizeHash is used to modify individual object properties in incoming payload. serialize is used to modify the outgoing object being sent to server. normalizedPayload is used to remove extraneous data from incoming payload such as meta data.
In Ember Data, serializers format the data sent to and received from the backend store. By default, Ember Data serializes data using the JSON:API format. If your backend uses a different format, Ember Data allows you to customize the serializer or use a different serializer entirely.
The docs explain them pretty well, but here is my take on it:
normalize
is used to modify root object in incoming payload.
normalizeHash
is used to modify individual object properties in incoming payload.
serialize
is used to modify the outgoing object being sent to server.
normalizedPayload
is used to remove extraneous data from incoming payload such as meta data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With