Skip to content

Instantly share code, notes, and snippets.

@adamhjk
Created April 22, 2020 14:30
Show Gist options
  • Save adamhjk/3ad83b5676297cc6af8db8c38a9489c2 to your computer and use it in GitHub Desktop.
Save adamhjk/3ad83b5676297cc6af8db8c38a9489c2 to your computer and use it in GitHub Desktop.
A simple example of typescript being helpful
interface AssociationConstructor {
typeName: Association["typeName"];
methodName: Association["methodName"];
fieldName?: Association["fieldName"];
}
interface BelongsToConstructor
extends Omit<AssociationConstructor, "methodName"> {
fromFieldPath: BelongsTo["fromFieldPath"];
methodName?: Association["methodName"];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment