To allow us more flexibility and be a little bit more correct we should rename the event of the media queries plugin event name from viewportChanged to viewportEntered.
Also we should export the event name as variable so that we get type safety and a future dev will understand the source of the event:
import {VIEWPORT_ENTERED} from '@gondel/plugin-media-queries';
@EventListener(VIEWPORT_ENTERED)
We could also provide a viewportEvents enum instead:
import {viewportEvents} from '@gondel/plugin-media-queries';
@EventListener(viewportEvents.viewportChanged)
// or
@EventListener(viewportEvents.VIEWPORT_CHANGED)
To allow us more flexibility and be a little bit more correct we should rename the event of the media queries plugin event name from
viewportChanged
toviewportEntered
.Also we should export the event name as variable so that we get type safety and a future dev will understand the source of the event:
We could also provide a
viewportEvents
enum instead: