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

Make 'Function' a generic type #203

Merged
merged 13 commits into from
May 2, 2018
Merged

Make 'Function' a generic type #203

merged 13 commits into from
May 2, 2018

Conversation

CyrusNajmabadi
Copy link
Contributor

Followup to #202

@CyrusNajmabadi
Copy link
Contributor Author

@lukehoban can you take a look?

Copy link
Contributor

@lukehoban lukehoban left a comment

Choose a reason for hiding this comment

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

LGTM

/**
* Handler is the signature for a callback that be converted into an aws lambda entrypoint.
*/
export type Handler<TArg, TResult> = (event: TArg, context: Context, callback: (error: any, result: TResult) => void) => any;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this TFoo naming style common in TypeScript - I feel like I don't see it much.

Separately, perhaps the first type param should be Event not `Arg?

Is Handler<E, R> too succinct?

@CyrusNajmabadi CyrusNajmabadi merged commit dfb423e into master May 2, 2018
readonly identity: any;
readonly clientContext: any;
getRemainingTimeInMillis(): string;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not positive - but I think we may have dependencies on this type from @pulumi/cloud. We could choose to leave it here to avoid breaking clients (as an alias for the type in the other namespace), or could just assume that these changes you are making require a version bump to avoid getting automatically picked up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. tehse should go with a version bump.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

talking to matt about this.

@CyrusNajmabadi CyrusNajmabadi deleted the genericFunc branch May 2, 2018 23:11
CyrusNajmabadi pushed a commit that referenced this pull request May 7, 2018
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.

2 participants