merkle-open / gondel

🚡 Gondel is a tiny library to bootstrap frontend components
https://gondel.js.org
MIT License
36 stars 10 forks source link

Media Queries Plugin Event Name #4

Closed jantimon closed 6 years ago

jantimon commented 6 years ago

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)