Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export WorkboxEventMap from workbox-window #2870

Merged
merged 1 commit into from
Jun 23, 2021
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @tropicadri
CC: @ivandotv

Fixes #2860

Exporting the existing event mapping seemed cleaner than exporting a bunch of events directly alongside the other symbols.

This should allow for use cases like:

import {Workbox, WorkboxEventMap} from 'workbox-window';

const handleWaiting = (event: WorkboxEventMap['waiting']) => {
  // ...
};

const wb = new Workbox('sw.js');
wb.addEventListener('waiting', handleWaiting);

@tropicadri tropicadri merged commit 06a561a into v6 Jun 23, 2021
@jeffposnick jeffposnick deleted the export-WorkboxEventMap branch July 14, 2021 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript confusion
2 participants