Dhtmlx/codebase2/chart.js
// view + key serve as the vm's unique identity
view + key serve as the vm's unique identity
view + key serve as the vm ' s unique identity
function ViewModel(view, data, key, opts) {
	var vm = this;
	vm.view = view;
	vm.data = data;
	vm.key = key;
	if (opts) {
		vm.opts = opts;
		vm.config(opts);
	}
	var out = isPlainObj(view) ? view : view.call(vm, vm, data, key, opts);
	if (isFunc(out))
		{ vm.render = out; }
	else {
		vm.render = out.render;
		vm.config(out);
	}
	vm._redrawAsync = raft(function (_) { return vm.redraw(true); });
	vm._updateAsync = raft(function (newData) { return vm.update(newData, true); });
	vm.init && vm.init.call(vm, vm, vm.data, vm.key, opts);
}
function ViewModel ( view , data , key , opts ) { var vm = this ; vm . view = view ; vm . data = data ; vm . key = key ; if ( opts ) { vm . opts = opts ; vm . config ( opts ) ; } var out = isPlainObj ( view ) ? view : view . call ( vm , vm , data , key , opts ) ; if ( isFunc ( out ) ) { vm . render = out ; } else { vm . render = out . render ; vm . config ( out ) ; } vm . _redrawAsync = raft ( function ( _ ) { return vm . redraw ( true ) ; } ) ; vm . _updateAsync = raft ( function ( newData ) { return vm . update ( newData , true ) ; } ) ; vm . init && vm . init . call ( vm , vm , vm . data , vm . key , opts ) ; }
view + key serve as the vm's unique identity
view + key serve as the vm ' s unique identity
// these must be wrapped here since they're debounced per view