Skip to content

Add basic branching. #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

rstone770
Copy link

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
Copy link
Owner

atticoos commented Feb 5, 2017

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
Copy link
Owner

atticoos commented Jun 6, 2017

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