Skip to content

Use wrapPick with dynamic imports; make wrapPick synchronous#5

Merged
winton merged 3 commits into
mainfrom
dynamic-imports-wrapPick
Apr 9, 2026
Merged

Use wrapPick with dynamic imports; make wrapPick synchronous#5
winton merged 3 commits into
mainfrom
dynamic-imports-wrapPick

Conversation

@winton

@winton winton commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • wrapPick is now synchronous — it composes wrap(pick(...)) directly and returns an immediately callable wrapped function instead of a Promise<WrappedFunction>. No await needed at the call site.
  • The src/example/controlFlow.ts example is updated to use a single import() variable with wrapPick for each function — no static imports, no wrap calls.
  • README updated throughout: the "Why typectl?", "Core concepts", and all relevant API sections now showcase promise-chaining without await, with wrapPick elevated as a key primitive alongside wrap.

Test plan

  • npm test passes (38 tests)
  • wrapPick no longer requires await at the call site
  • Dynamic import pattern works end-to-end in src/example/spec.ts

Made with Cursor

winton added 3 commits April 9, 2026 00:18
- wrapPick now returns an immediately callable wrapped function instead
  of a Promise, by composing wrap(pick(...)) synchronously
- Example updated to use wrapPick with a single dynamic import()
- README updated: core concepts, all API examples, and the Why section
  now emphasize promise-chaining without await

Made-with: Cursor
@winton winton merged commit a797230 into main Apr 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant