diff --git a/lib/use-data-nav.js b/lib/use-data-nav.js index 1339661..24eb12f 100644 --- a/lib/use-data-nav.js +++ b/lib/use-data-nav.js @@ -1,15 +1,11 @@ -import { useMemo } from 'haunted'; import { useIncompleteTemplate } from './use-incomplete-template'; import { useCache } from './use-cache'; -export const useDataNav = el => { - const incompleteTemplates = useMemo(() => ({ +export const useDataNav = el => ({ + cache: useCache(el), + incompleteTemplates: { [el.selected - 1]: useIncompleteTemplate(el.selected - 1, el.items.length), [el.selected]: useIncompleteTemplate(el.selected, el.items.length), [el.selected + 1]: useIncompleteTemplate(el.selected + 1, el.items.length) - }), [el.selected, el.items.length]); - return { - cache: useCache(el), - incompleteTemplates - }; -}; + } +});