refactor(lib): extract fillArray utility

This commit is contained in:
Eric Liu 2019-12-23 09:47:34 -08:00
commit f3c702947c
7 changed files with 23 additions and 10 deletions

View file

@ -5,7 +5,7 @@
export let rowCount = 5;
export let style = undefined;
import { cx } from '../../lib';
import { cx, fillArray } from '../../lib';
const _class = cx(
'--skeleton',
@ -13,7 +13,7 @@
border && '--structured-list--border',
className
);
const rows = Array.from({ length: rowCount - 1 }, (_, i) => i);
const rows = fillArray(rowCount - 1);
</script>
<section on:click on:mouseover on:mouseenter on:mouseleave class={_class} {style}>