Add basic branching. - #10
Open
rstone770 wants to merge 1 commit into
Open
Conversation
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 Going to spend a day thinking about this, but I do lean towards looking at merging this. Thanks for contributing |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.