From 59358e2650ebc0ad6dcc929b5dbf1e14913a48ed Mon Sep 17 00:00:00 2001 From: Johannes Homeier Date: Sat, 18 Nov 2023 11:29:57 +0100 Subject: [PATCH] docs(composables/class): add example --- libs/composables/class/src/provide-base-class.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/composables/class/src/provide-base-class.ts b/libs/composables/class/src/provide-base-class.ts index 55df441..c11fe17 100644 --- a/libs/composables/class/src/provide-base-class.ts +++ b/libs/composables/class/src/provide-base-class.ts @@ -7,10 +7,24 @@ export const BASE_CLASS = new InjectionToken('@bynary/composables/class. /** * Provide a base CSS class that should be applied to a host. + * The base class can be injected using the {@link BASE_CLASS} token. + * This token will be used by {@link useModifier} and {@link useModifierGroup} to generate modifier classes. * * @see useModifier * @see useModifierGroup * + * @example + * ```ts + * @Component({ + * selector: 'my-component', + * providers: [ + * provideBaseClass('my-component') + * ] + * }) + * class MyComponent { + * baseClass = inject(BASE_CLASS); // 'my-component' + * } + * * @param baseClass - The base class to provide. */ export const provideBaseClass = (baseClass: string) => ({