-
-
Save OliverJAsh/bed05c84fdf1d057ab5fc29033e81d4f to your computer and use it in GitHub Desktop.
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
// render.ts | |
import * as states from './states'; | |
export const render = (state: states.State) => { | |
switch (state.type) { | |
case states.StateType.Form: | |
return 'Form'; | |
case states.StateType.Loading: | |
return `Loading results for ${state.query}`; | |
case states.StateType.Failed: | |
return 'Failed'; | |
case states.StateType.Gallery: | |
return `Results: ${state.items.length}`; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment