Skip to content

feat(once): implement once function with documentation and tests - #91

Open
EhsanKey wants to merge 3 commits into
mainfrom
feat/once-function
Open

feat(once): implement once function with documentation and tests#91
EhsanKey wants to merge 3 commits into
mainfrom
feat/once-function

Conversation

@EhsanKey

@EhsanKey EhsanKey commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Related to #90

@EhsanKey
EhsanKey requested a review from ASafaeirad December 5, 2025 17:45
@EhsanKey EhsanKey self-assigned this Dec 5, 2025
@EhsanKey EhsanKey added the proposal New feature or request label Dec 5, 2025
@ASafaeirad
ASafaeirad requested a review from Copilot December 19, 2025 12:44
@ASafaeirad

Copy link
Copy Markdown
Member

Hey @copilot, please review this PR

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a once function that ensures a given function is executed only once, caching and returning the first invocation's result on subsequent calls.

  • Implements the once function with proper TypeScript generics and context preservation
  • Adds comprehensive test coverage including edge cases (async functions, errors, falsy values)
  • Provides documentation with usage examples

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/function/once.ts Core implementation of the once wrapper function
src/function/once.spec.ts Test suite covering various scenarios and edge cases
src/function/index.ts Exports the new once function
docs/pages/function/once.mdx User-facing documentation with examples
docs/pages/function/_meta.json Adds once to documentation navigation

馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/function/once.spec.ts Outdated
Comment thread src/function/once.ts Outdated

Copilot AI commented Dec 19, 2025

Copy link
Copy Markdown

@ASafaeirad I've opened a new pull request, #92, to work on those changes. Once the pull request is ready, I'll request review from you.

ASafaeirad and others added 2 commits December 19, 2025 13:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: ASafaeirad <28571761+ASafaeirad@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants