3 ms·
I am a huge fan of triples to represent things. I've even written an engine that takes triples and renders web apps. This is effectively a todo MVC as triples
by samsquire 6y ago
I am a huge fan of triples to represent things.
I've even written an engine that takes triples and renders web apps.
This is effectively a todo MVC as triples:
var template = {
"predicates": [
"NewTodo leftOf insertButton",
"Todos below insertButton",
"Todos backedBy todos",
"Todos mappedTo todos",
"Todos key .description",
"Todos editable $item.description",
"insertButton on:click insert-new-item",
"insert-new-item 0.pushes {\"description\": \"$item.NewTodo.description\"}",
"insert-new-item 0.pushTo $item.todos",
"NewTodo backedBy NewTodo",
"NewTodo mappedTo editBox",
"NewTodo editable $item.description",
"NewTodo key .description"
],
"widgets": {
"todos": {
"predicates": [
"label hasContent .description"
]
},
"editBox": {
"predicates": [
"NewItemField hasContent .description"
}
}
},
"data": {
"NewTodo": {
"description": "Hello world"
},
"todos": [
{
"description": "todo one"
},
{
"description": "todo two"
},
{
"description": "todo three"
}
]
}
}
See https://elaeis.cloud-angle.com/?p=71 https://elaeis.cloud-angle.com/?p=71
and
https://github.com/samsquire/additive-guis https://github.com/samsquire/additive-guis