Advertisement
Guest User

Untitled

a guest
Feb 13th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. // l => lastLocation
  2. // n => nextLocation
  3. // 只有路径变更或者查询参数变更,才需要请求 facets,否则只用重新获取 content
  4. const fetchAll = (l, n) => {
  5. // 主路径不一致,抓取所有
  6. if (l.pathname !== n.pathname) return true;
  7.  
  8. const lq = getQueryParams(l.search);
  9. const nq = getQueryParams(n.search);
  10. // 查询参数不一样,抓取所有
  11. return lq['q'] !== nq['q'];
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement