function useIpfs (ipfs, cmd, opts) {
  const [res, setRes] = useState(null)
  useEffect(() => {
    callIpfs(ipfs, cmd, opts, setRes)
  }, [ipfs, cmd, opts])
  return res
}
/*
 * Pass the command you'd like to call on an ipfs instance.
 *
 * Uses setState to capture the response, so your component
 * will re-render when the result turns up.
 *
 */
Pass the command you'd like to call on an ipfs instance.
Uses setState to capture the response, so your component
will re-render when the result turns up.
Pass the command you ' d like to call on an ipfs instance . Uses setState to capture the response so your component will re - render when the result turns up .
function useIpfs (ipfs, cmd, opts) {
  const [res, setRes] = useState(null)
  useEffect(() => {
    callIpfs(ipfs, cmd, opts, setRes)
  }, [ipfs, cmd, opts])
  return res
}
function useIpfs ( ipfs , cmd , opts ) { const [ res , setRes ] = useState ( null ) useEffect ( ( ) => { callIpfs ( ipfs , cmd , opts , setRes ) } , [ ipfs , cmd , opts ] ) return res }
Pass the command you'd like to call on an ipfs instance.
Pass the command you ' d like to call on an ipfs instance .