wasp/waspc/examples/todoApp/ext/actions.js
Martin Sosic faf34a7d26 Added react-query, implemented useQuery wrapper for it, refactored Todo
example app to use new queries, removed old Wasp code from it.
2020-09-03 17:52:34 +02:00

9 lines
221 B
JavaScript

import state from './state.js'
export const createTask = (task, context) => {
if (Math.random() < 0.5) {
throw new Error('Failed to create task, random error!')
}
state.tasks = [...(state.tasks || []), task]
}