paf31 / purescript-thermite

A simple PureScript wrapper for React
MIT License
350 stars 55 forks source link

implement Contravariant instance for Spec #85

Closed coot closed 7 years ago

coot commented 7 years ago

I had to change the Spec type so that props is the last type argument - so it's a breaking change.

paf31 commented 7 years ago

Sorry to be difficult, but when I said helper function, I meant the mapProps function you mentioned. I would really like to avoid breaking the API at this point, if possible.

Out of curiosity, are you using props? I haven't used them for much in Thermite.

coot commented 7 years ago

It makes sense. I'll close this PR, you can merge it when time comes for bigger changes.

Indeed, there is not much point of using props in Thermite. The one I can think off is when you split your application in various React components and only parts of the app are governed by Thermite. Then it may happen that you have a Thermite Spec that you want to reuse but the prop type does not match. That'd be a reason to use mapProps (a better name for it would be cmapProps).