typeResolver setting example
Hi,
Can you please provide an example for using typeResolver? (Typescript please)
Thanks
Hi, @mustafaekim
This is not yet in TypedJSON, as it is currently undergoing a complete rewrite. Once implemented though, the setting will require a callback function accepting the source Object being deserialized, the Map of known-type constructors, as well as the constructor of the expected type. It will be expected to return one of the elements from the Map of known-types, or any other constructor that is deemed the correct one.
OK thanks for the support. I changed the variable name to __type and I move on
There is an example here now : https://github.com/JohnWeisz/TypedJSON/issues/88#issuecomment-454334197