Closed kyasu1 closed 7 years ago
Hi @kyasu1, thanks for the contribution!
I'd prefer to leave off the unsafe
variant, if possible. Why is it necessary in your opinion?
Hi @ohanhi, thank you for reviewing and taking your time.
After thinking carefully, I realized that having unsafe
variant is a kind of cheating and it should not be exposed in the public API as you mentioned. With proper encoder/decoder and programWithFlags
, we can pass JS object through Elm code to JS native functions, though writing decoders is still a pain for me >.< Anyway, removed the unsafe
code and pushed again.
Awesome, thanks!
The title says about adding Flags support, but actually I needed a way to pass a JS props object to native JS functions through Elm program without knowing details, that means no decoding and encoding.
unsafeProgramWithFlags
is pretty useful for such case though no guarantee of type safety. I will show you my usage if necessary.