Skip to content

Documentation / @warp-drive/legacy / compat / serializerFor

Function: serializerFor()

ts
function serializerFor(this, modelName): 
  | null
  | MinimumSerializerInterface;

Defined in: warp-drive-packages/legacy/src/compat.ts:116

Returns an instance of the serializer for a given type. For example, serializerFor('person') will return an instance of App.PersonSerializer.

If no App.PersonSerializer is found, this method will look for an App.ApplicationSerializer (the default serializer for your entire application).

If a serializer cannot be found on the adapter, it will fall back to an instance of JSONSerializer.

Parameters

this

Store

modelName

string

the record to serialize

Returns

| null | MinimumSerializerInterface

Released under the MIT License.