Lets' say I have different kind of document type, how I get their document type in html-serializer
?
export default function (type, element, content, children) {
... // how to know which doc they come from?
}
I check all the arguments but none of them stated their doc type, is that not possible?
Sure, I know we can define local serializer like this one HTML Serializer with Vue.js - Prismic so we can have different serializer for different document
But I think it's better and more convenience if we can define it in one place only, so we can do this instead
export default function (doc, type, element, content, children) {
if (doc.type === "Blog") ...
}
Or is there any alternative? Thanks