Created
September 8, 2020 13:45
-
-
Save perjo927/8085f3988bb1ae2c099aca2939919950 to your computer and use it in GitHub Desktop.
Create Todo Item
This file contains hidden or 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
import { generateId } from "../id/index.js"; | |
export const createTodoBase = (text) => ({ text, done: false }); | |
export const createTodoItem = (todoObj, idObj) => ({ | |
...todoObj, | |
...idObj, | |
}); | |
export const getTodoItem = (text) => { | |
const idObj = generateId(); | |
const todoObj = createTodoBase(text); | |
return createTodoItem(todoObj, idObj); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment