UNPKG

@shopify/draggable

Version:

The JavaScript Drag & Drop library your grandparents warned you about.

38 lines (27 loc) 487 B
class AbstractEvent { static type = 'event'; static cancelable = false; _canceled = false; constructor(data) { this.data = data; } get type() { return this.constructor.type; } get cancelable() { return this.constructor.cancelable; } cancel() { this._canceled = true; } canceled() { return this._canceled; } clone(data) { return new this.constructor({ ...this.data, ...data }); } } export { AbstractEvent };