Re: [w3c/ServiceWorker] Declarative routing (#1373)

@shortercode

> I was thinking it would either return a new instance of `RouterCondition`, with a { startsWith: "/avatars/" } configuration or an instance of `RouterIfURLStarts` ( which would inherit/implement `RouterCondition` ). RouterCondition itself would be exposed on serviceworkerglobalscope but as an illegal constructor.

`RouterCondition` isn't specific enough, so it'd have to be `RouterIfURLStarts`. But then, why have a method that returns an instance + an illegal constructor, when a valid constructor can do the same job. That's how I ended up using constructors.

> Can anyone think of any methods that Conditions or Sources would actually need?

Yep, I documented some above. See "Are instances useful?".



-- 
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-452284710

Received on Tuesday, 8 January 2019 12:42:01 UTC