Skip to content

Conversation

VictorAugDB
Copy link
Contributor

Create an interface to repeatable type and use destructuring with deafult value to remove unnecessary code

@VictorAugDB VictorAugDB changed the title reduce duplcation and remove unnecessary code reduce duplication and remove unnecessary code May 17, 2022
Create an interface to repeatable type and use destructuring with deafult value to remove unnecessary code
@@ -1,39 +1,35 @@
import { Application, HookFn, makeApp } from '@/_lib/Application';

type EntrypointFn<T extends Record<string | symbol, any>> = (arg: Context<T>) => Promise<void>;
type RecordAny<T extends string | symbol = string | symbol> = Record<T, any>

Choose a reason for hiding this comment

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

Just for curiosity but this is a kind of thing we should place as a shared type? cc/ @talyssonoc

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