var doc = document

class Touch {
    constructor(obj) {
        this.defaults = obj

        this.ele = doc.querySelector(this.defaults.selector)

        if (this.ele.length == 0) return

        this.events = {}

        this.init()

    }
    init() {
        this.events['touchstart'] = (e) => {
            console.log(e)
            this.defaults.touchStart.call(null)
        }

        this.on('touchstart', this.events['touchstart'])
    }
    on(type, callback) {
        this.ele.addEventListener(type, callback, false)
    }
    off(type, callback) {
        this.ele.removeEventListener(type, callback)
    }
}

module.exports = Touch