API reference@evolu/commonFunction › todo

function todo<T>(): T;

Defined in: packages/common/src/Function.ts:312

Development placeholder that always throws.

Use to sketch function bodies before implementing them. TypeScript infers the return type from context, so surrounding code still type-checks. Use an explicit generic when there is no return type annotation.

Example

import { todo } from "@evolu/common";

interface Config {
  readonly theme: string;
}

const getCount = (): number => todo();
const getConfig = () => todo<Config>();

expectTypeOf<
  [ReturnType<typeof getCount>, ReturnType<typeof getConfig>]
>().toEqualTypeOf<[number, Config]>();
expect(getCount).toThrow("not yet implemented");