コード例 #1
0
ファイル: ui.js プロジェクト: jld/gecko-dev
function onSelect(state, { accessible, response: ancestry, error }) {
  if (error) {
    console.warn("Error fetching ancestry", accessible, error);
    return state;
  }

  const { path, expanded } = updateExpandedNodes(state.expanded, ancestry);
  const selected = TreeView.subPath(path, accessible.actorID);

  return Object.assign({}, state, { expanded, selected });
}
コード例 #2
0
ファイル: ui.js プロジェクト: jld/gecko-dev
 const path = ancestry.reduceRight((accPath, { accessible }) => {
   accPath = TreeView.subPath(accPath, accessible.actorID);
   expanded.add(accPath);
   return accPath;
 }, "");