Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Client Utility Function for Result Sets #12

Open
adam-rocska opened this issue Jun 9, 2023 · 0 comments
Open

Client Utility Function for Result Sets #12

adam-rocska opened this issue Jun 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@adam-rocska
Copy link
Member

It's too fucking frequent that we do this:

const [mediaSet] = useMedia();
  const [media, setMedia] = useState<Array<MediaModel>>([]);
  useEffect(() => {
    if (!isResult(mediaSet)) return;
    setMedia(Array.from(mediaSet));
  }, [mediaSet]);

Using sets is a good pattern so far BUT it's inconvenient in most cases when you just directly hook the SWR live sets into your GUI.

It'd be nice to have another hook which would simply wrap the clientHook you'd use and play this given game ( ͡° ͜ʖ ͡°)

@adam-rocska adam-rocska added the enhancement New feature or request label Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant