You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hooks.js 377B

12345678910111213
  1. // @flow
  2. import { useSelector } from 'react-redux';
  3. /**
  4. * Takes a redux selector and binds it to specific values.
  5. *
  6. * @param {Function} selector - The selector function.
  7. * @param {...any} args - The values to bind to.
  8. * @returns {any}
  9. */
  10. export function useBoundSelector(selector: Function, ...args: any[]) {
  11. return useSelector(state => selector(state, ...args));
  12. }