Recompose: Docs broken about branch

Created on 12 Dec 2016  路  3Comments  路  Source: acdlite/recompose

The docs contains this:

// `hasLoaded()` is a function that returns whether or not the component
// has all the props it needs
const spinnerWhileLoading = hasLoaded =>
  branch(
    props => !hasLoaded(props),
    renderComponent(Spinner) // `Spinner` is a React component
  )

// Now use the `spinnerWhileLoading()` helper to add a loading spinner to any
// base component
const enhance = spinnerWhileLoading(
  props => props.title && props.author && props.content
)
const Post = enhance(({ title, author, content }) =>
  <article>
    <h1>{title}</h1>
    <h2>By {author.name}</h2>
    <div>{content}</div>
  </article>
)

But branch doesn't support only 2 arguments. I saw that there were a PR about this but it's not merged. https://github.com/acdlite/recompose/pull/227

Please publish the new functionality or change the docs!

Most helpful comment

Oops,
now I can publish on npm,
so new version available on npm 0.21.0, please check.

;-)

All 3 comments

Merged,
image
not published yet.

Documentation updated according to PRs, so the problem in releases,
having that only @acdlite can publish this repo, I can't say much when, why, who.

PS: Until release just use latest tag for the documentation
https://github.com/acdlite/recompose/tree/v0.20.2

Oops,
now I can publish on npm,
so new version available on npm 0.21.0, please check.

;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdomigan picture cdomigan  路  4Comments

joncursi picture joncursi  路  3Comments

rockchalkwushock picture rockchalkwushock  路  3Comments

jethrolarson picture jethrolarson  路  4Comments

isubasti picture isubasti  路  3Comments