/* service.component.js
*
*
*/

function initComponent(componentSchema) {
	return function(componentDependencies) {
		return function(stateConf, fn) {
			Object.keys(stateConf).forEach(function(prop) {	
				if (prop === "fn") {
					stateConf[prop](fn) 
					return
				}
				componentSchema[prop](stateConf, componentDependencies);
			});
		}
	}
}

module.exports = initComponent

