Skip to content

Commit

Permalink
Using _.partial() instead of bind()
Browse files Browse the repository at this point in the history
This is because bind() is typically used to change the value of this. As we
aren't actually changing the value of this here, using _.partial() explains
the intent more clearly, IMO.
  • Loading branch information
ycombinator committed Jun 2, 2016
1 parent 357e391 commit 484e45f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/settings/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defaultsDeep } from 'lodash';
import { defaultsDeep, partial } from 'lodash';
import defaultsProvider from './defaults';

export default function setupSettings(kbnServer, server, config) {
Expand Down Expand Up @@ -35,7 +35,7 @@ export default function setupSettings(kbnServer, server, config) {
return client
.get({ ...clientSettings })
.then(res => res._source)
.catch(userSettingsNotFound.bind(null, clientSettings.id))
.catch(partial(userSettingsNotFound, clientSettings.id))
.then(user => hydrateUserSettings(user));
}

Expand Down

0 comments on commit 484e45f

Please sign in to comment.