Created
February 17, 2017 18:16
-
-
Save saginadir/f7051bbdc11b7fa59073dbd79648899a to your computer and use it in GitHub Desktop.
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
const capitalize = (string) => | |
string.charAt(0).toUpperCase().concat(string.slice(1)); | |
const saveToDb = (db, entity) => | |
() => | |
db.save(entity); | |
const html = (selector, newHtml) => | |
() => | |
$(selector).html(newHtml); | |
const executeAll = () | |
function updateUserNameSaveToDb(user, newName, db) { | |
const newUser = {...user, name: capitalize(newName)} | |
const saveNewUserToDb = saveToDb(db, newUser); | |
const changeUserGreeting = html('.user-greet', `hello ${newUser.name}`) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment