Created
July 13, 2018 12:28
-
-
Save paulsonnentag/1627b6cbb0ea8a652fab813e6b9e851a to your computer and use it in GitHub Desktop.
Function Search
This file contains 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
Function Search | |
Start | |
search -> Start with Results | |
Start with Results | |
select function -> Function | |
delete all -> Start | |
Module | |
backspace -> Start | |
search -> Module | |
select function -> Function | |
Function | |
search -> Module | |
backspace -> Module |
This file contains 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
function render(model){ | |
const current_state_name = model.active_states[0].name; | |
switch (current_state_name) { | |
case 'Start': | |
return ( | |
<div> | |
<input/> | |
</div> | |
) | |
case 'Start with Results': | |
return ( | |
<div> | |
<input value='List.map'/> | |
<ul> | |
<li onClick={() => model.emit('select function')}>List.map</li> | |
</ul> | |
</div> | |
) | |
case 'Module': | |
return ( | |
<div> | |
<input value='elm-lang/core'/> | |
<ul> | |
<li onClick={() => model.emit('select function')}>List.map</li> | |
</ul> | |
</div> | |
) | |
case 'Function': | |
return ( | |
<div> | |
<input value='elm-lang/core/List.map'/> | |
<ul> | |
<li> | |
<pre>{` | |
code snipped 1 | |
code`}</pre> | |
</li> | |
<li> | |
<pre>{` | |
code snippet 2 | |
List.map`}</pre> | |
</li> | |
</ul> | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment