open-nomad/ui/app/routes/variables/path.js
Phil Renaud 4c58356af1 Path Tree compaction refactor (#13415)
* Bones of a just-in-time compaction pathTree

* wooo got compaction going in sub-ms times

* PR cleanup

* Path compaction tests

* lint fix to equal instead of .ok()

* Name prop specifically being equality checked
2022-07-11 13:34:05 -04:00

13 lines
336 B
JavaScript

import Route from '@ember/routing/route';
export default class VariablesPathRoute extends Route {
model({ absolutePath }) {
const treeAtPath =
this.modelFor('variables').pathTree.findPath(absolutePath);
if (treeAtPath) {
return { treeAtPath, absolutePath };
} else {
return { absolutePath };
}
}
}