Skip to content

Commit

Permalink
Added jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Mar 25, 2020
1 parent 3e4030a commit 33b8b9c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/block-library/src/navigation/use-api-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
import { useEffect } from '@wordpress/element';
import apiFetch from '@wordpress/api-fetch';

/**
* Function that fetches data using apiFetch, and updates the status.
*
* @param {Function} setIsRequesting function to set requesting state to true or false.
* @param {Function} setData Function to set data being returned, or empty array on error.
* @param {string} path Query path.
*/
export default function useApiFetch( setIsRequesting, setData, path ) {
useEffect( () => {
// Indicate the fetching status
Expand Down

0 comments on commit 33b8b9c

Please sign in to comment.