Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/effector/packages/effector/index.d.ts>createApi

Business logic with ease ☄️
Go to Latest
function createApi
import { createApi } from "https://deno.land/x/effector@effector-react%4023.2.0/packages/effector/index.d.ts";

Shorthand for creating events attached to store by providing object with reducers for them

Type Parameters

S
Api extends { [name: string]: ((store: S, e: any) => (S | void)); }

Parameters

target store

api: Api

object with reducers

Returns

[K in keyof Api]: ((store: S, e: void) => (S | void)) extends Api[K] ? EventCallable<void> : Api[K] extends ((store: S) => (S | void)) ? EventCallable<void> : Api[K] extends ((store: S, e: infer E) => (S | void)) ? EventCallable<E extends void ? Exclude<E, undefined> | void : E> : any