- From: Jake Archibald <notifications@github.com>
- Date: Wed, 09 Jan 2019 04:42:57 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 9 January 2019 12:43:23 UTC
After thinking about it, I think I'm going to go with the object based approach & @domenic's suggestion:
```js
// Without options:
router.add(
conditions,
'cache',
);
// With options:
router.add(
conditions,
{ type: 'cache', request: '/shell.html' },
);
// Multiple sources:
router.add(
conditions,
[
'cache',
'network',
{ type: 'cache', request: '/shell.html' },
],
);
```
I'm still not keen on having objects with a required property that determines the type of the object, but it seems better than the alternatives.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1373#issuecomment-452683477
Received on Wednesday, 9 January 2019 12:43:23 UTC