Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cl/export async helpers #913

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
NPM_VERSION: ${{steps.vars.outputs.version}}

- name: Publish
run: npm publish --access=public
run: npm publish --access=public --tag=next
working-directory: ./build/npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
9 changes: 9 additions & 0 deletions lib/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ export interface Callable<
* or plain function to call as part of this operation
*/

export function call<T, TArgs extends unknown[] = []>(
fn: (...args: TArgs) => Promise<T>,
): Operation<T>;
export function call<T, TArgs extends unknown[] = []>(
fn: (...args: TArgs) => T,
): Operation<T>;
export function call<T, TArgs extends unknown[] = []>(
fn: (...args: TArgs) => Operation<T>,
): Operation<T>;
export function call<T, TArgs extends unknown[] = []>(
callable: Callable<T, TArgs>,
...args: TArgs
Expand Down
1 change: 1 addition & 0 deletions lib/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ export * from "./events.ts";
export * from "./abort-signal.ts";
export * from "./main.ts";
export * from "./with-resolvers.ts";
export * from "./async.ts";
Loading