Skip to content

Add basic branching. - #10

Open
rstone770 wants to merge 1 commit into
atticoos:masterfrom
rstone770:master
Open

Add basic branching.#10
rstone770 wants to merge 1 commit into
atticoos:masterfrom
rstone770:master

Conversation

@rstone770

Copy link
Copy Markdown

Hey

I added simple branching support to your project. It allows for basic else/else if branching which i find very useful in my own projects.

great job on the library btw.

@atticoos

atticoos commented Feb 5, 2017

Copy link
Copy Markdown
Owner

This is very elegant, nicely done.

Branching is something I've been wanting to take a look at, but haven't had time to sit down and really think about what that design should look like.

I had originally been thinking about something like:

renderIf.condition(
  renderIf.if(foo === 'bar')(
    <span>Is bar</span>
  )
  .elseIf(foo === 'foo')(
    <span>Is foo</span>
  )
  .else(
    <span>Something else</span>
  )
)

But I like the simplicity of the or idea here.

Going to spend a day thinking about this, but I do lean towards looking at merging this. Thanks for contributing

@atticoos atticoos self-assigned this Feb 5, 2017
@atticoos
atticoos self-requested a review February 5, 2017 04:10
@atticoos

atticoos commented Jun 6, 2017

Copy link
Copy Markdown
Owner

Hey @rstone770 - would you like to take a look at #13? I've been thinking about the most ergonomic way to approach this and am pretty happy with the results. Curious to hear your thoughts.

I'm still interested in this approach as well, perhaps both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants