Closed JPrisk closed 6 years ago
Hey @JPrisk! That's a really great idea, I should have considered that up front.
Do you have any ideas on what the API should be like? I imagine it could be as simple as passing an object instead of an array as a route i.e.:
operator('#root', [
{ path: '/cart', cache: false, load () {} }
])
@estrattonbailey yea, the suggestion you've made would work well. I guess it would require a rewrite to implement as the current processes rely on a key/ value paring? I'm going to convert the cart page to make an AJAX request on load.
Yeah, should be pretty simple to make objects optional. Would be happy to review a PR if you wanted to have a look at it. I might get to it this weekend also.
@JPrisk have a look at the new API. Published as a minor version, you'll just need to run npm i operator@latest --save
.
Will this work for you?
@estrattonbailey awesome Eric! I'll drop it into my project tomorrow. Ignoring routes is a good idea too
@estrattonbailey, i've been enjoying testing out operator. Was just wondering if it is possible to omit pages from the cache, for example a cart page?