Skip to content

3.2.0

Choose a tag to compare

@ivklgn ivklgn released this 02 Jun 12:18
· 4 commits to main since this release
b23c951

What's Changed

  • feat: branded types for context, subcontext and features by @ivklgn in #11

Full Changelog: 3.1.2...3.2.0

Updates

  1. Improve types for subcontext and features
  const createErrorContext = createError([{ errorType: "ErrorType1" }, { errorType: "ErrorType2" }] as const);
  // ErrorSubcontext<ContextName, "ErrorType1" | "ErrorType2">

  const errorContext = createErrorContext("Context");
  // ErrorSubcontext<"Context", "ErrorType1" | "ErrorType2">
  
  const featureError = errorContext.feature("Feature");
  // ErrorFeature<"Context/Feature", "ErrorType1" | "ErrorType2">
  1. Add new utility type readme