Skip to content

Instantly share code, notes, and snippets.

@domosedov
Created February 3, 2025 08:48
Show Gist options
  • Save domosedov/bb60e31742e26a34824251c1d93af01d to your computer and use it in GitHub Desktop.
Save domosedov/bb60e31742e26a34824251c1d93af01d to your computer and use it in GitHub Desktop.
Effector typed withFactory
// @ts-expect-error effector does not have public types of withFactory
import { withFactory as withFactoryBase } from 'effector';
type WithFactory = <R>({
sid,
name,
loc,
method,
fn,
}: {
sid: string;
name?: string;
loc?: unknown;
method?: string;
fn: () => R;
}) => R;
export const withFactory = withFactoryBase as WithFactory;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment