WIP: docs: add type narrowing section and fix delayed state description #1
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
chocbite/ts-lib-state!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/add-readme-examples-sync-lazy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The readme incorrectly described delayed states as always-async, and lacked any documentation on how to use the
rsync,rok,writable, andwsyncproperties for type narrowing against theState<RT>union.Changes
Fix delayed state description
Anotation entry: async on initial load only, sync once resolvedawaitonce, thenget()/ok()work synchronously thereafterAdd type narrowing section
New section placed after the notation table explaining the four boolean discriminant properties:
truersyncget()rokok(), result isResultOk<RT>writablewrite()wsyncwrite_sync()Checking these properties narrows the
State<RT>union at both compile time and runtime — no casts needed:📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.
Pull request closed