Skip to content

Commit

Permalink
implement depdendencies argument
Browse files Browse the repository at this point in the history
  • Loading branch information
nerrad committed May 22, 2019
1 parent e4d8a47 commit c8c2ca8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/data/src/components/use-select/index.js
Expand Up @@ -30,7 +30,8 @@ const useIsomorphicLayoutEffect =

const renderQueue = createQueue();

export default function useSelect( mapSelect ) {
export default function useSelect( _mapSelect, deps ) {
const mapSelect = useMemo( () => _mapSelect, deps );
const registry = useRegistry();
const isAsync = useAsyncMode();
const queueContext = useMemo( () => ( { queue: true } ), [ registry ] );
Expand Down Expand Up @@ -63,7 +64,7 @@ export default function useSelect( mapSelect ) {
}

useIsomorphicLayoutEffect( () => {
latestMapSelect.current = mapSelect;
latestMapSelect.current = _mapSelect;
if ( latestIsAsync.current !== isAsync ) {
latestIsAsync.current = isAsync;
renderQueue.flush( queueContext );
Expand Down

0 comments on commit c8c2ca8

Please sign in to comment.