altjs / utils

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

copies static methods to HOC #19

Open kellyrmilligan opened 8 years ago

kellyrmilligan commented 8 years ago

this copies static methods on the component class sent to connect to stores. this would be valuable for components that are at the top level, and in an SPA you may want to call fetch for server side rendering from a pre-defined method. this makes no assumptions on what the name of that method should be. you may also just want to call the fetch method before rendering, and being able to specify that in the component is nice.

taion commented 8 years ago

Why not just use hoist-non-react-statics here?

kellyrmilligan commented 8 years ago

Ummm..yes. Let me research that and modify the Pr.

kellyrmilligan commented 8 years ago

https://github.com/reactjs/react-redux/issues/276

Sounds good to me. Let me modify this Pr with that instead.

kellyrmilligan commented 8 years ago

@taion good idea. if approve would it be possible to publish this as a minor version as well? I see #15 would like this as well.

taion commented 8 years ago

That's up to @goatslacker 😄

kellyrmilligan commented 8 years ago

otherwise looks good though? I added a test as well :)

kellyrmilligan commented 8 years ago

@taion updated. @goatslacker thoughts?

kellyrmilligan commented 8 years ago

I guess for now I can use same technique on the component returned from connect until this is merged in right? Just would be nice to include it inline with the other statics

kellyrmilligan commented 8 years ago

@goatslacker @taion should I just close this PR?

kellyrmilligan commented 8 years ago

@goatslacker @taion status?