-
Notifications
You must be signed in to change notification settings - Fork 1
API #1
Comments
Definitely |
I'm also thinking of a utility method that makes the core stampit library available, for times when a mixin may not need to be a React component. Would eliminate the need for importing import stampit from 'react-stampit'
const mixin = stampit.stampit(); |
I don't understand what you mean. Could you provide a more complete use case? |
import stampit from 'react-stampit';
const nonReactStampMixin = stamit.stampit({
foo() {}
});
const reactStampMixin = stampit(Render, {
propTypes: {}
});
const reactStamp = stampit(Render, {
render() {}
}).compose(nonReactStampMixin, reactStampMixin); |
Browserify auto-dedupes and npm dedupes in v3+. Don't you think it makes more sense for people who want direct stampit access to just |
What you are saying does make total sense, what I was proposing was nothing more than a convenience method. I was considering the use case where a module may have a reason to have a non-react mixin stamp AND and a react stamp in the same file... but that may not be a use case to worry much about. I'll leave the method out. |
👍 |
Added the |
@ericelliott
Created #2 with more details on my proposed composition implementation. |
@ericelliott Merged PR #2, composition should be pretty much fully functional for React. Let me know if you see anything missing or have other ideas! |
This API is looking great so far. I'm going to start using it in my production apps and see how it works for me. BTW, thanks for helping to get those issues resolved in React. =) 👍 |
Sounds great! You're welcome, I'm glad they were accepted. |
Let's discuss what the final API should look like. Do we want to include any of stampit's utility methods?
Public Stamp Interface
- [ ] stamp.methods- [ ] stamp.state- [ ] stamp.encloseUtility Methods
The text was updated successfully, but these errors were encountered: