add navigation manager to streamline titles and breadcrumbs
This commit is contained in:
@@ -24,6 +24,17 @@ export const defaultIconProps: IconComponentProps = {
|
||||
*/
|
||||
export type MaybeGetter<T> = T | (() => T);
|
||||
|
||||
/**
|
||||
* ResolveGetter returns the underlying value stored by a MaybeGetter type.
|
||||
* @returns Raw value T or function return T.
|
||||
*/
|
||||
export const resolveGetter = <T>(getter: MaybeGetter<T>): T => {
|
||||
if (typeof getter === 'function') {
|
||||
return (getter as () => T)();
|
||||
}
|
||||
return getter;
|
||||
};
|
||||
|
||||
/**
|
||||
* Generates a unique identifier string unless an identifier is provided.
|
||||
* If a prefix is provided, it will be prepended to the identifier.
|
||||
|
||||
Reference in New Issue
Block a user