This is because R.propSatisfies
has a different method signature to that of R.isEmpty
.
In the case of your first approach:
branch(R.propSatisfies(R.isEmpty, "repos"), renderComponent(Loader))
the R.propSatisfies
function is evaluating a function (R.isEmpty
) on a property ("repos"
) of the input object (ie which is the object returned from renderComponent(Loader)
).
In the case of your second approach:
// branch(R.isEmpty("repos"), renderComponent(Loader)),
what you're doing here is calling R.isEmpty
directly. The R.isEmpty
method expects an array, and returns true if the supplied array is empty. R.isEmpty
doesn't have the ability to determine if a property (ie "repos") in an object is empty or not. To make it easier to visualise what's going on here, consider the following:
// Your second approach:
branch(R.isEmpty("repos"), renderComponent(Loader))
// ...which when expanded, is equivalent to this. You can now see it
// shows incorrect usage of R.isEmpty
branch(component => R.isEmpty("repos")(component), renderComponent(Loader))
Hope this offers some clarification - for more information on R.isEmpty
, see this link