Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

default third argument of branch to identity function #227

Merged
merged 1 commit into from Aug 10, 2016

Conversation

conorhastings
Copy link
Contributor

closes #226

@@ -34,3 +34,18 @@ test('branch tests props and applies one of two HoCs, for true and false', t =>
t.is(getIsBad(), 'true')
t.is(getName(), 'Heisenberg')
})

test.only('branch defaults third argument to identity function', t => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove only, please :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acdlite 🙈 sorry, removed

const branch = (
test,
left,
right = baseComponent => baseComponent
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit hard to read. Could you define identity above and use that instead?

@acdlite
Copy link
Owner

acdlite commented Aug 10, 2016

Nice, thanks!

@kevinrenskers
Copy link

Great that this got merged (it's a change I also wanted to ask for), but when will a new version of recompose be published to npm?

istarkov pushed a commit that referenced this pull request Oct 31, 2016
* Fix mapPropsStream's example

It seems like in the docs, `Observable` refers to `Rx.Observable`.

In Rx4 and Rx5, `Rx.Observable.interval` emits numbers, not objects.

* Advertise `withProps`

* Clean-up some comments

* Fix links to the React documentation

* Improve renderComponent's doc

Since faaafb0 (#227), branch's third argument defaults to the identity
function. This is a nice addition and we probably want to advertise it
in renderComponent's doc.

* Remove dead code

Since 390697a (#180, 2016-05-21), branch()'s `{Left,Right}Component`
internal instance variables are not used anymore.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

branch to complicated
3 participants