Skip to content
On this page

Farfetched and Solid

Integration is distributed as a separate package, you have to install it and its peer dependency before usage:

sh
pnpm install @farfetched/solid effector-solid
sh
yarn add @farfetched/solid effector-solid
sh
npm install @farfetched/solid effector-solid

Showcases

createQueryResource

It is analogue of SoildJS createResource, but uses Query as a source and fetcher.

tsx
import { createQueryResource } from '@farfetched/solid';

function UserProfile() {
  const [user] = createQueryResource(userQuery);

  return (
    <Suspense fallback={<p>Loading...</p>}>
      <ErrorBoundary fallback={<p>User could not be shown</p>}>
        <section>
          <p>{user()?.name}</p>
          <p>{user()?.email}</p>
        </section>
      </ErrorBoundary>
    </Suspense>
  );
}

Released under the MIT License.