Skip to content

Commit

Permalink
feat(signals): get last signal triggered by recorder
Browse files Browse the repository at this point in the history
  • Loading branch information
christianalfoni committed Feb 4, 2016
1 parent a77fb35 commit aa47a85
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ module.exports = function (options) {
var isCatchingUp = false
var startSeek = 0
var catchup = null
var lastSignal = null

// Runs the signal synchronously
var triggerSignal = function (signal) {
lastSignal = signal
var signalName = signal.name.split('.')
var signalMethodPath = signalMethods
while (signalName.length) {
Expand Down Expand Up @@ -157,6 +159,10 @@ module.exports = function (options) {
if (isRecording) addSignal(args.signal)
}

function getLastSignal () {
return lastSignal
}

module.alias(MODULE)

var state = options.state || {}
Expand All @@ -167,6 +173,7 @@ module.exports = function (options) {

var services = {
getCurrentSeek: getCurrentSeek,
getLastSignal: getLastSignal,
getRecording: getRecording,
loadRecording: loadRecording,
record: record,
Expand Down

0 comments on commit aa47a85

Please sign in to comment.