import { createSelector } from 'reselect';

const getRouteSections = state => state.route.sections || [];

export const getAnchorLinks = createSelector(getRouteSections, sections =>
  sections.filter(section => section.anchor).map(section => ({
    label: section.label,
    hash: section.hash
  }))
);

export default { getAnchorLinks };

@@ -98,16 +98,66 @@
 s %7C%7C %5B%5D;
+%0Aconst getSearch = state =%3E state.location.search;
 %0A%0Aexport
@@ -195,16 +195,20 @@
 elector(
+%0A  %5B
 getRoute
@@ -221,22 +221,48 @@
 ns, 
-sections
+getSearch%5D,%0A  (sections, search)
  =%3E%0A  
+ 
+ 
 sect
@@ -322,16 +322,18 @@
  (%7B%0A    
+  
 label: s
@@ -346,16 +346,18 @@
 .label,%0A
+  
     hash
@@ -370,17 +370,59 @@
 ion.hash
-%0A
+,%0A      path: section.path,%0A      search%0A  
   %7D))%0A);

Add search and path to anchor links selector