Skip to content

Common Patterns

This page helps TypeScript developers build intuition for how code should be reshaped in Targo.

Async flows

Instead of translating Promise and await one-for-one, decide:

  • whether concurrency is needed at all
  • which channels carry results
  • how failures are represented

Collection work

Instead of defaulting to JS arrays everywhere, decide:

  • do you want slice<T>?
  • or do you explicitly want Array<T> methods?

Classes

Instead of translating extends, decide:

  • is this structure reuse?
  • behavior reuse?
  • or a capability boundary better modeled as an interface?