Quickstart
Install
pnpm add funkciaImport what you need
import { Option, Result } from 'funkcia';
import { OptionAsync } from 'funkcia/option-async';
import { ResultAsync } from 'funkcia/result-async';Start with Option
Optionimport { Option } from 'funkcia';
declare function findUserEmail(userId: string): string | null;
const email = Option.fromNullable(findUserEmail('user_123'))
.filter((value) => value.includes('@'))
.unwrapOr(() => 'guest@example.com');Use Result for typed failures
Result for typed failuresMove to async with OptionAsync and ResultAsync
OptionAsync and ResultAsyncNext steps
Last updated
Was this helpful?