title: How to combine custom hooks and selector results?
body: <p>I have a custom hook and also have some selectors and need a final flag to be set based on a combination of the two.
  I can't simply write a function that combines the code below cos neither hooks or selectors can be used outside a react FC</p>
  
  <p>What's the best way to make the whole block like this a single reusable function somewhere?</p>
  
  <pre><code>// selector
      const { activeIntents, writeRole, intents, permalink } = useSelector(state =&gt; state.companyIntentsReducer);
  // custom hook
      const { hasExtendedRoleForCompany } = useJwtRoles();
  // func calling the custom hook
      const intentWrite = hasExtendedRoleForCompany("intent-manage-write", permalink);
  // final result combines both
      const editMode = writeRole &amp;&amp; intentWrite
  </code></pre>
  
  <p>can custom hooks use selectors?</p>