Skip to content

Instantly share code, notes, and snippets.

@abulka
Created May 17, 2020 11:47
Show Gist options
  • Save abulka/749c88f4337fa4031afe8064dab498b7 to your computer and use it in GitHub Desktop.
Save abulka/749c88f4337fa4031afe8064dab498b7 to your computer and use it in GitHub Desktop.
TodoMVC-ECS Gathering Todos
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