Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private bindEvents() {
const events = Object.keys(NativeFlicking.EVENTS)
.map(key => NativeFlicking.EVENTS[key]);
events.forEach(eventName => {
this.flicking.on(eventName, e => {
e.currentTarget = this;
const emitter = this[eventName]; // Style guide: Event - https://angular.io/guide/styleguide#dont-prefix-output-properties
if (emitter) {
emitter.emit(e);
if (eventName === 'visibleChange') {
const list = this.counter(this.panels.length * (this.flicking.getCloneCount() + 1));
const min = e.range.min;
const max = e.range.max;
const visibles = min >= 0
private $_bindEvents() {
const events = Object.keys(NativeFlicking.EVENTS)
.map(key => NativeFlicking.EVENTS[key]);
events.forEach(eventName => {
this.$_nativeFlicking.on(eventName, e => {
e.currentTarget = this;
// Make events from camelCase to kebab-case
this.$emit(eventName.replace(/([A-Z])/g, "-$1").toLowerCase(), e);
});
});
if (this.options.renderOnlyVisible) {
this.$_nativeFlicking.on(NativeFlicking.EVENTS.VISIBLE_CHANGE, e => {
this.$forceUpdate();
});
}
}
.map(key => NativeFlicking.EVENTS[key]);
.map(key => NativeFlicking.EVENTS[key]);