/*!
	State Model Sample Code -- action object
	--------------------------------------------
	Copyright 2009 Kevin Dolan
	-http://www.thekevindolan.com
	
	Code licensed under the MIT license
	-See license.txt
	
	v0.1
*/

/*! public, accessible
	action constructor
	Params: record of the following
		-commit : The part of the action to do before any call is made
		-[onSuccess] : Action to be done after response has been processed successfully
		-[onError] : Error handling
*/
function action(params) {
	
	this.commit = params.commit;
	
	if(util.isDefined(params.onSuccess))
		this.onSuccess = params.onSuccess;
	else
		this.onSuccess = function() {};
		
	if(util.isDefined(params.onError))
		this.onError = params.onError;
	else
		this.onError = function() {};
	
	return true;
}
