Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // l => lastLocation
- // n => nextLocation
- // 只有路径变更或者查询参数变更,才需要请求 facets,否则只用重新获取 content
- const fetchAll = (l, n) => {
- // 主路径不一致,抓取所有
- if (l.pathname !== n.pathname) return true;
- const lq = getQueryParams(l.search);
- const nq = getQueryParams(n.search);
- // 查询参数不一样,抓取所有
- return lq['q'] !== nq['q'];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement