-
-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Description
I am trying to serialize a Set (using custom propSchema like in #157), but would like the result to use a reference inside the custom PropSchema to point to objects in the Set.
This doesn't work though:
import {identifier, reference, createModelSchema} from 'serializr'
// transmitters is a Set
// Transmitter is the class of each Set item
createModelSchema(Receiver, {
id: identifier(),
// Want this to be a list of refs
transmitters: custom((model) => {
const array = Array.from(model)
return array.map(() => {
return reference(Transmitter)
})
}, deserializer)
})Is there a way to do this?
Metadata
Metadata
Assignees
Labels
No labels