wasp/waspc/examples/todoApp/ext/actions.js

9 lines
221 B
JavaScript
Raw Normal View History

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]
}