Skip to main content
Version: 2.0.0-alpha

Function: firestoreToCMSModel

firestoreToCMSModel<M>(data): any

Recursive function that converts Firestore data types into CMS or plain JS types. FireCMS uses Javascript dates internally instead of Firestore timestamps. This makes it easier to interact with the rest of the libraries and bindings. Also, Firestore references are replaced with EntityReference

Type parameters

Name
M

Parameters

NameType
dataany

Returns

any

Defined in

lib/src/firebase_app/hooks/useFirestoreDataSource.ts:470