3 ms·
I like this! For golfing purposes, you can remove a branch too: function fetchFirstUser(isWhatIWant, callback) { knex.first().from('users')
by spankalee 10y ago
I like this!
For golfing purposes, you can remove a branch too:
function fetchFirstUser(isWhatIWant, callback) {
knex.first().from('users')
.then((user) => ({ user }), (e) => ({ e }))
.then(({ user, e }) => callback(e, user))
.catch((e) => console.error(e));
}