Comparing version 1.0.0 to 1.1.0
@@ -161,2 +161,6 @@ "use strict"; | ||
checkState(_state){ | ||
return (this.states[_state] === true ? true : false); | ||
} | ||
clearState(_event){ | ||
@@ -163,0 +167,0 @@ delete this.states[_event]; |
{ | ||
"name": "arc-events", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Independent Events class", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -138,2 +138,5 @@ # arc-events [![Build Status](https://travis-ci.org/anyuzer/arc-events.svg?branch=master)](https://travis-ci.org/anyuzer/arc-events) | ||
### .checkState(`state:String`) | ||
Check to see whether a state has fired. Returns `true` or `false` | ||
### .once(`event:String, listener:Function [,customId:Mixed]`) | ||
@@ -140,0 +143,0 @@ Set a callback to listen for an event being emitted. When the listener fires, it will automatically be removed internally as a listener and will no longer fire on subsequent events. |
@@ -54,2 +54,14 @@ "use strict"; | ||
tap.test('ArcEvents.checkState',function(_test){ | ||
EventTest.clear(); | ||
//Has not fired | ||
_test.equal(EventTest.checkState('loaded'),false); | ||
EventTest.emitState('loaded'); | ||
//Has fired | ||
_test.equal(EventTest.checkState('loaded'),true); | ||
_test.end(); | ||
}); | ||
tap.test('ArcEvents.setCatchAll',function(_test){ | ||
@@ -56,0 +68,0 @@ EventTest.clear(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21573
390
205