Profectus / features/feature / getFirstFeature
Function: getFirstFeature() ​
getFirstFeature<
T
>(features
,filter
):object
Utility function for taking a list of features and filtering them out, but keeping a reference to the first filtered out feature. Used for having a collapsible of the filtered out content, with the first filtered out item remaining outside the collapsible for easy reference.
Type Parameters ​
• T extends VueFeature
Parameters ​
features ​
T
[]
The list of features to search through
filter ​
(feature
) => boolean
The filter to use to determine features that shouldn't be collapsible
Returns ​
object
An object containing a ref to the first filtered out feature, a render function for the collapsed content, and a ref for whether or not there is any collapsed content to show
collapsedContent() ​
collapsedContent: () =>
Renderable
Returns ​
firstFeature ​
firstFeature:
Ref
<T
|undefined
>
hasCollapsedContent ​
hasCollapsedContent:
Ref
<boolean
>