You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find my self in a situation where I had to prepare a method only to support me with unit tests.
I am using typescript and typing was not helping me to for example, access properties from metadata without code repetition.
Further more, I found that I could not store object instances in metadata because it would have problems during serialization among services. Thus, metadata would only work nicely with simple types (strings/number/etc).
One workaround I found was to use a HOF to build the mixin with closure over the complex types I needed to maintain.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I find my self in a situation where I had to prepare a method only to support me with unit tests.
I am using typescript and typing was not helping me to for example, access properties from
metadata
without code repetition.Further more, I found that I could not store object instances in
metadata
because it would have problems during serialization among services. Thus,metadata
would only work nicely with simple types (strings
/number
/etc).One workaround I found was to use a HOF to build the mixin with closure over the complex types I needed to maintain.
E.g:
if somehow I could define getters it would be more syntactically meaningful?
Beta Was this translation helpful? Give feedback.
All reactions