Closed arunoda closed 7 years ago
We should also look at documenting how to use recompose if needed.
Expecting
Nice @arunoda! Looking forward to it
I'm HIGHLY opposed to using this
to access context
. Why not pass it in as an argument?
For that matter, I think the args that are passed in should be an object rather than ordered parameters:
const dataLoader = ({props, onData, onError, context}) => {
// Fetch from the data.
return aa.subscribe();
};
This API is much cleaner and you can simply ignore the arguments that you don't use. With the example you give using arrow functions the this
context wouldn't even be set properly. Using this
adds quite a bit of surface area for bugs.
@clayne11 yep. I agree and I found it confusing specially with the arrow functions. So, now I am using it as you are describing. It's now on v2 branch and we are using it on production.
How soon will v2 merge to master?
Hm, I think the old pattern/usage was simpler.
by the way, react-komposer share some functionality with https://github.com/acdlite/recompose (like composeAll / merge is mostly the same like recompose' compose). Did you think about using it under the hood?
@macrozone we only use a single feature of recompose which is merge
. It's a few lines of code and I hope the API is bit different too.
We use react-komposer for data loading, but after that it's possible to use recompose or use recomposed UI components with react-komposer.
Closing since I've released it. But feel free to open new issues for questions.
We've been pretty busy with some internal apps these days. Sorry for not updating. When we are building it and looking at some of these issues, I think we need to re-think about the API.
Here's what we are looking to have in 2.x (Which will be out pretty soon).