Created
May 17, 2020 11:47
-
-
Save abulka/749c88f4337fa4031afe8064dab498b7 to your computer and use it in GitHub Desktop.
TodoMVC-ECS Gathering Todos
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
let todos_data = [] | |
engine.system('reset-todo-list', ['housekeeping'], (entity, { housekeeping }) => { | |
todos_data = [] | |
}); | |
engine.system('gather-todos-for-save', ['data'], (entity, { data }) => { | |
todos_data.push(data) // or push data.title, or push the entity, or whatever you need | |
}); | |
engine.system('report-final-result', ['housekeeping'], (entity, { housekeeping }) => { | |
console.log('final list of todos', todos_data) | |
}); | |
engine.tick() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment