Skip to content

Instantly share code, notes, and snippets.

@Tiagoperes
Created February 9, 2023 14:49
Show Gist options
  • Save Tiagoperes/f445a78c1296016d00937fdedaaec09c to your computer and use it in GitHub Desktop.
Save Tiagoperes/f445a78c1296016d00937fdedaaec09c to your computer and use it in GitHub Desktop.
Nimbus To Do App Tutorial - Part 1
{
"_:component":"layout:lifecycle",
"state":{
"isLoading":true,
"notes":[
]
},
"children":[
{
"_:component":"if",
"children":[
{
"_:component":"then",
"children":[
{
"_:component":"layout:text",
"properties":{
"text":"Loading"
}
}
]
},
{
"_:component":"else",
"children":[
{
"_:component":"layout:column",
"children":[
{
"_:component":"forEach",
"children":[
{
"_:component":"layout:column",
"children":[
{
"_:component":"layout:text",
"properties":{
"weight":"bold",
"text":"@{item.date}"
}
},
{
"_:component":"forEach",
"children":[
{
"_:component":"layout:text",
"properties":{
"text":"@{item.title}"
}
}
],
"properties":{
"key":"id",
"items":"@{item.items}"
}
}
],
"properties":{
"marginTop":5
}
}
],
"properties":{
"key":"date",
"items":"@{notes}"
}
}
]
}
]
}
],
"properties":{
"condition":"@{isLoading}"
}
}
],
"properties":{
"onInit":[
{
"_:action":"sendRequest",
"properties":{
"onError":[
{
"_:action":"log",
"properties":{
"level":"error",
"message":"@{onError.message}"
}
}
],
"onSuccess":[
{
"_:action":"setState",
"properties":{
"path":"notes",
"value":"@{onSuccess.data}"
}
}
],
"url":"https://gist.githubusercontent.com/Tiagoperes/3888902b98494708202fa05569444451/raw/dbc705192e2f87233da2f1eec35936aef8125545/todo.json",
"onFinish":[
{
"_:action":"setState",
"properties":{
"path":"isLoading",
"value":false
}
}
]
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment