Skip to content

Commit

Permalink
move visitable to run
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0gr committed Oct 29, 2019
1 parent f7768e2 commit 8e19acf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions addon-test-support/properties/visitable.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assign } from '../-private/helpers';
import { getExecutionContext } from '../-private/execution_context';
import run from '../-private/run';

import $ from '-jquery';

Expand Down Expand Up @@ -95,16 +95,15 @@ export function visitable(path) {

get() {
return function(dynamicSegmentsAndQueryParams = {}) {
let executionContext = getExecutionContext(this);

return executionContext.runAsync((context) => {
return run(this, ({ visit }) => {
let params = assign({}, dynamicSegmentsAndQueryParams);
let fullPath = fillInDynamicSegments(path, params);

fullPath = appendQueryParams(fullPath, params);

return context.visit(fullPath);
});
return visit(fullPath);
})
}
}
};
Expand Down

0 comments on commit 8e19acf

Please sign in to comment.