12 lines
366 B
JavaScript
12 lines
366 B
JavaScript
import { useOverflowContext } from './overflowContext';
|
|
/**
|
|
* @returns Number of items that are overflowing
|
|
*/ export const useOverflowCount = ()=>useOverflowContext((v)=>{
|
|
return Object.entries(v.itemVisibility).reduce((acc, [id, visible])=>{
|
|
if (!visible) {
|
|
acc++;
|
|
}
|
|
return acc;
|
|
}, 0);
|
|
});
|