Skip to content

oliverphaser/nativescript-eventify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm apple android
support

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.

NativeScript 8

This will work only on NativeScript 8.

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

ns plugin add @oliverphaser/nativescript-eventify

Usage

Just require it once.

//app.js
require("@oliverphaser/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

Properties Required Description
EventData Yes The eventName and object, just like using notify.
Info Sometimes Some of the events (i.e. swipe) will need extra information

Info

Event Required Properties Description
tap No n/a n/a

About

NativeScript notify() method does't always work, this one does.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 71.5%
  • Shell 17.9%
  • JavaScript 10.6%