Skip to content

Commit

Permalink
use optional params system for buildComputed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Apr 25, 2017
1 parent 922fe7c commit 3ffdb0d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions addon/-build-computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function parseComputedArgs(args) {
};
}

function buildCallback(collapsedKeys, incomingCallback, getValue) {
function buildCallback({ collapsedKeys, incomingCallback, getValue }) {
let newCallback;

function createArgs(context) {
Expand Down Expand Up @@ -36,12 +36,12 @@ function buildCallback(collapsedKeys, incomingCallback, getValue) {
return newCallback;
}

export default function(args, collapseKeys, getValue, flattenKeys) {
export default function({ args, collapseKeys, getValue, flattenKeys }) {
let { keys, callback: incomingCallback } = parseComputedArgs(args);

let collapsedKeys = collapseKeys(keys);

let newCallback = buildCallback(collapsedKeys, incomingCallback, getValue);
let newCallback = buildCallback({ collapsedKeys, incomingCallback, getValue });

return computed(...flattenKeys(keys), newCallback);
}
2 changes: 1 addition & 1 deletion addon/computed-unsafe.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import flattenKeys from './flatten-keys-unsafe';
const collapseKeys = keys => keys;

export default function(...args) {
return buildComputed(args, collapseKeys, getValue, flattenKeys);
return buildComputed({ args, collapseKeys, getValue, flattenKeys });
}
2 changes: 1 addition & 1 deletion addon/computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import getValue from './get-value';
import flattenKeys from './flatten-keys';

export default function(...args) {
return buildComputed(args, collapseKeys, getValue, flattenKeys);
return buildComputed({ args, collapseKeys, getValue, flattenKeys });
}

0 comments on commit 3ffdb0d

Please sign in to comment.