1.0.1 • Published 5 years ago

nativescript-eventify v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

android ios

NativeScript Eventify

NativeScript has a method called notify you can use to notify an observable of changes. But you can't use it to trigger events like tap or swipe, enter NativeScript Eventify.

Supported Events

  • tap

Roadmap

  • Add support for doubleTap events
  • Add support for longPress events
  • Add support for swipe events
  • Add support for pan events
  • Add support for pinch events
  • Add support for rotate events
  • Add support for touch events

Installation

tns plugin add nativescript-eventify

Usage

Just require it once.

//app.js
require("nativescript-eventify");
/**
* home-page.js
*
* Assume the view already has the event listner(s) setup.
*/

// Simulates a tap event
view.eventify({ eventName: "tap", object: view });

Take a look at this Playground for a working example.

API

PropertiesRequiredDescription
EventDataYesThe eventName and object, just like using notify.
InfoSometimesSome of the events (i.e. swipe) will need extra information

Info

EventRequiredPropertiesDescription
tapNon/an/a