Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Releases: jxom/react-loads

9.2.3

19 Jun 07:57
Compare
Choose a tag to compare

Initial release

9.2.1

26 May 04:46
Compare
Choose a tag to compare

Patches

  • Add debounceCache option: 662c0d4
    • This option will persist the results from the previous query until new ones have fetched.

9.2.0

26 May 03:12
Compare
Choose a tag to compare

Features

  • Add ability to debounce invocation of the async function, using the debounce config option. Example:
async function fetchRandomDog({ value }) {
  const response = await axios.get(`https://dog.ceo/api/breed/${value}/images/random);
  return response;
}

export default function RandomDog() {
  const [value, setValue] = React.useState('poodle');

  const { isPending, isResolved, response } = useLoads('random-dog', fetchRandomDog, { 
    debounce: 1000,
    variables: [{ value }]
  });

  return (
    <div>
      <input 
        placeholder="Search for a dog..." 
        onChange={e => setValue(e.target.value)} 
        value={value} 
      />
      {isPending && 'Loading...'}
      {isResolved && (
        <img src={response.data.message} />
      )}
    </div>
  )
}

9.1.4

11 May 22:48
Compare
Choose a tag to compare

Patches

  • Fix deduping for manual invoke: b18e081
  • Fix isReloadingSlow not triggering: #45

Credits

Huge thanks to @roNn23 for helping!

9.1.2

29 Mar 23:17
Compare
Choose a tag to compare

Patches

  • Fix pending state for useDeferredLoads without a context (should never be in isReloading state): 9720d55

9.1.1

06 Mar 00:59
Compare
Choose a tag to compare

Patches

  • Fix issue where error wasn't throwing in suspense mode: 63fdae6

9.1.0

02 Mar 03:50
Compare
Choose a tag to compare

9.0.6

18 Feb 04:34
Compare
Choose a tag to compare

Patches

  • Fix preload for stale and dupe records: 611fab9

9.0.5

17 Feb 02:11
Compare
Choose a tag to compare

Patches

  • Spread options in LoadFunction type: #42
  • Do not broadcast on rejected state: #43

Credits

Huge thanks to @samantha-wong and @thepenskefile for helping!

9.0.4

07 Feb 05:00
Compare
Choose a tag to compare

Patches

  • Make config parameter optional in TS: e4591eb