API reference@evolu/commonFunction › todo

function todo<T>(): T;

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

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 {
  assertEqual,
  assertErr,
  assertInstanceOf,
  assertType,
  todo,
  trySync,
} from "@evolu/common";

interface Config {
  readonly theme: string;
}

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

assertType<
  [ReturnType<typeof getCount>, ReturnType<typeof getConfig>],
  [number, Config]
>();
const result = trySync(getCount);
assertErr(result);
assertInstanceOf(result.error, Error);
assertEqual(result.error.message, "not yet implemented");