Skip to content

Commit

Permalink
working on the framework
Browse files Browse the repository at this point in the history
  • Loading branch information
designfrontier committed Apr 25, 2014
1 parent 0e797c4 commit c208aed
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions public/javascripts/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ var action = function(){
var returnObject = objectIn
, localEvents = {};

//set an emitter id for troubleshooting
returnObject.emitterId = Math.ceil(Math.random() * 10000);

//create the lcoal event Store
returnObject.eventStore = {};

returnObject.emit = function(eventNameIn, eventDataIn, localFlag){
//add the emitterID to this thing
var eventStack
Expand Down Expand Up @@ -270,7 +274,7 @@ var action = function(){
};

//Event Based state machine
this.requiredEvent = function(name, callback, context, fireMultipleIn){
returnObject.requiredEvent = function(name, callback, context, fireMultipleIn){
var stateUpdate;

this._fireMultiple = (typeof fireMultipleIn !== 'undefined') ? fireMultipleIn : false;
Expand All @@ -292,7 +296,7 @@ var action = function(){
this.event(name, callback, context);
};

this.stateUpdate = function(nameIn, stateEventsIn){
returnObject.stateUpdate = function(nameIn, stateEventsIn){
var name = nameIn
, stateEvents = stateEventsIn
, that = this;
Expand Down Expand Up @@ -326,8 +330,7 @@ var action = function(){
}
}, returnObject);

returnObject.eventStore = {};

//execute the init function if it exists
if(typeof returnObject.init === 'function'){
returnObject.init.apply(returnObject);
}
Expand Down

0 comments on commit c208aed

Please sign in to comment.