@v4fire/client
Version:
V4Fire client core library
32 lines (25 loc) • 661 B
text/typescript
/*!
* V4Fire Client Core
* https://github.com/V4Fire/Client
*
* Released under the MIT license
* https://github.com/V4Fire/Client/blob/master/LICENSE
*/
/**
* [[include:core/component/directives/in-view/README.md]]
* @packageDocumentation
*/
import { ComponentEngine } from 'core/component/engines';
import { InView, Adaptee, InViewDirectiveOptions } from 'core/dom/in-view';
export * from 'core/dom/in-view';
ComponentEngine.directive('in-view', {
inserted(el: Element, {value}: InViewDirectiveOptions): void {
if (!Adaptee || !value) {
return;
}
InView.observe(el, value);
},
unbind(el: Element): void {
InView.remove(el);
}
});