Open
Description
Description
This is my implementation:
type Val = "A" | "B" | "C"
class MyClass {
mySet: Set = new Set()
}
here when I put
@type(() => Set) or @type(() => Set)) above line mySet: Set = new Set()
instanceToPlain is not giving set, instead converting into empty array (set is empty)
Proposed solution
Found this solution from this questions raised on this sub.
putting this works:
@expose()
@Transform(({ value }) => new Set(value)))
Do i have to use transform? and Why?
Sorry if it a repeated question.