Last active
August 29, 2015 14:15
-
-
Save dagingaa/53d6910a3b681601123f 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
// The following is a thought experiment of how it COULD work | |
// todos-template.js | |
export default (todos) => { | |
return ` | |
<div class="todo-wrapper"> | |
<p>Remaining: ${ todos.length }</p> | |
<ul class="todos"> | |
${ todos.map(todo => `<li class="${ todo.completed }">${ todo.text }</li>`) } | |
</ul> | |
</div> | |
`; | |
} | |
// main.js | |
import TodosTemplate from "todos-template"; | |
import ReactView from 'react'; | |
class TodosView extends ReactView { | |
constructor() { | |
super(); | |
this[todos] = []; | |
} | |
render() { | |
return TodosTemplate(this[todos]); | |
} | |
} | |
var todosView = new TodosView(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment