altjs / utils

A collection of utils for alt.js
37 stars 25 forks source link

Allow setting propTypes for the component container created by connec… #18

Closed aifreedom closed 8 years ago

aifreedom commented 8 years ago

…tToStore

Adding a way to set the propTypes of StoreConnection component returned by connectToStore.

I have a real use case for this: I have an Article component which takes an article object as props and I'm using connectToStore to connect it to an ArticleStore. The StoreConnection component returned from connectToStore takes an articleID as its props and uses that to get the article object from store and passes it down to the stateless Article component.

Before this, I can't require this StoreConnection to have an articleID props. Now with connectorPropTypes in Spec, it's possible.

aifreedom commented 8 years ago

Hmm, after a second thought, this can be achieved after StoreConnection is returned. Closing this PR.