How to use touch

Comprehensive touch code examples:

How to use touch.isTouch:

4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
  this.handlersMap = this.buildHandlersMap()
}


ViewPort.prototype = Object.create(Observer.prototype)
ViewPort.prototype.isPointerEvent = touch.isPointerEvent
ViewPort.prototype.isTouch = touch.isTouch


ViewPort.prototype.buildHandlersMap = function () {
  if (this.slideDirection === this.chapterDirection) {
    return this.setHandlersMap(this.slideSwipeEvents)

How to use touch.isPointerEvent:

4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326


  this.handlersMap = this.buildHandlersMap()
}


ViewPort.prototype = Object.create(Observer.prototype)
ViewPort.prototype.isPointerEvent = touch.isPointerEvent
ViewPort.prototype.isTouch = touch.isTouch


ViewPort.prototype.buildHandlersMap = function () {
  if (this.slideDirection === this.chapterDirection) {

How to use touch.events:

4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
    this.tapHandler.bind(this)
  ])
}


ViewPort.prototype.getMapEvents = function (events) {
  return !isMitouchSPA() ? events : events.concat([touch.events.start, touch.events.end, 'tap'])
}


ViewPort.prototype.startEventHandler = function (event) {
  setTimeout(function () {

How to use touch.sync:

156
157
158
159
160
161
162
163
164
165
166
167
      sanitize(datestr + '-' + note.title + '-' + note._id.substr(5)) + '.html'
    const filePath = path.join(pathToSave, fileName)
    const outputHtml = await generateHtml(note, { pathToSave })


    fs.writeFileSync(filePath, outputHtml, 'utf-8')
    touch.sync(filePath, { time: new Date(note.updatedAt) })
  }
}


async function generateHtml(note, opts = {}) {

How to use touch.touchSync:

768
769
770
771
772
773
774
775
776
777
  if (!exists) {
    if (state.opts.outputDir) {
      mkdirp.sync(nodePath.dirname(cssFileOnDisk));
    }

    touch.touchSync(cssFileOnDisk);
  }

  fs.writeFileSync(cssFileOnDisk, toWrite);
}