UNPKG

@pageworks/pjax

Version:

Turns any website into a SPA using Fetch and link prefetching.

11 lines (10 loc) 338 B
import Pjax from "../../pjax"; /** * Builds an array of elements based on the string array provided by the options object. * @param el - `document.body` element * @returns `Array<Element>` */ export default (el:Element, pjax:Pjax)=>{ const elements = Array.from(el.querySelectorAll(pjax.options.elements)); return elements; }