doc: comments for codebase and updated documentation
This commit is contained in:
@@ -4,6 +4,11 @@ import type { FilterConfig } from '../../model';
|
||||
|
||||
/**
|
||||
* Create a filter manager instance.
|
||||
* - Uses debounce to update search query for better performance.
|
||||
* - Manages filter instances for each group.
|
||||
*
|
||||
* @param config - Configuration for the filter manager.
|
||||
* @returns - An instance of the filter manager.
|
||||
*/
|
||||
export function createFilterManager<TValue extends string>(config: FilterConfig<TValue>) {
|
||||
const search = createDebouncedState(config.queryValue ?? '');
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import type { FontshareParams } from '$entities/Font';
|
||||
import type { FilterManager } from '../filterManager/filterManager.svelte';
|
||||
|
||||
/**
|
||||
* Maps filter manager to fontshare params.
|
||||
*
|
||||
* @param manager - Filter manager instance.
|
||||
* @returns - Partial fontshare params.
|
||||
*/
|
||||
export function mapManagerToParams(manager: FilterManager): Partial<FontshareParams> {
|
||||
return {
|
||||
q: manager.debouncedQueryValue,
|
||||
|
||||
Reference in New Issue
Block a user