Skip to content

Commit a435168

Browse files
committed
chore(createTrinity): code cleanup
1 parent 065f52c commit a435168

File tree

1 file changed

+16
-10
lines changed
  • packages/0/src/factories/createTrinity

1 file changed

+16
-10
lines changed

packages/0/src/factories/createTrinity/index.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
11
// Types
22
import type { App, Ref } from 'vue'
33

4-
export type ContextTrinity<Z = unknown, E = unknown> = readonly [
4+
export type ContextTrinity<
5+
Z = unknown,
6+
E = unknown,
7+
> = readonly [
58
() => Z,
69
(model?: Ref<E>, context?: Z, app?: App) => Z,
710
Z,
811
]
912

1013
/**
11-
* Converts individual composable parts to a standardized context trinity pattern.
12-
* This utility abstracts the common pattern of returning [createContext, provideContext, context].
14+
* A tuple containing Vue's provide/inject and a context object
15+
* @param createContext The function that creates the context
16+
* @param provideContext The function that provides context
17+
* @param context The underlying context object singleton
18+
* @template Z The type parameter for the context value
19+
* @template E The vmodel type for the context state.
20+
* @returns [createContext,provideContext,context]
1321
*
14-
* @param createContext The context hook function
15-
* @param provideContext The underlying context provider function
16-
* @param context The context object
17-
* @template Z The context type
18-
* @template E The model type
19-
* @returns A trinity containing [createContext, provideContext, context]
22+
* @see https://0.vuetifyjs.com/composables/foundation/create-trinity
2023
*/
21-
export function createTrinity<Z = unknown, E = unknown> (
24+
export function createTrinity<
25+
Z = unknown,
26+
E = unknown,
27+
> (
2228
createContext: () => Z,
2329
provideContext: (model?: Ref<E>, _context?: Z, app?: App) => Z,
2430
context: Z,

0 commit comments

Comments
 (0)