'use strict';
(function(){
	var diffEngine = {};
	var contentArr = [];

	diffEngine.getEncoder = function() {
		var encoder = {
			push: function(content) {
				contentArr.push(content);
			}
		};

		return encoder;
	};

	diffEngine.getDecoder = function() {
		var decoder = {
			getContent: function() {
				return contentArr[ contentArr.length-1 ];
			}
		};

		return decoder;
	}

	window.diffEngine = diffEngine;
})();
'use strict';

window.diffEngine = (function(){

	var _contentArr = [];
	var _prevContent = '';

	var encoder = {
		push: function(content) {
			_contentArr.push(content);
		}
	};

	var decoder = {
		getContent: function() {
			return _contentArr[ _contentArr.length-1 ];
		}
	};

	function getEncoder() {
		return encoder;
	}

	function getDecoder() {
		return decoder;
	}

	return {
		getEncoder: getEncoder,
		getDecoder: getDecoder
	};

})();
change pattern structure