Class: Mixin

Mixin

Built.Mixin should be used to merge Plain JavaScript object, Built.Group or Built.GroupMultiple together

new Mixin(data){Object}

utilities/mixin.js, line 3
This should be used to mix instances of Built.Group, Built.GroupMultiple and Plain JavaScript object together
Name Type Description
data Object | Built.Group | Built.GroupMultiple Can be 1] Plain JavaScript object 2] Instance of Built.Group 3] Instance of Built.GroupMultiple
Example
// Consider you have a group field 'employee' which has to sub-group 'profile' and 'address'
var profile = Built.Group('profile',{
   name:'John',
   gender: 'Male'	
})
var address = Built.Group('address',{
   city:'Mumbai',
   area: 'Borivali'	
})
var employee = Built.Mixin(profile, address);
console.log(employee.toJSON())
// OUTPUT
//{ 
//   profile:{
//      name:'John',
//      gender: 'Male'
//   },
//   address:{
//      city:'Mumbai',
//      area:'Borivali'
//   }	
//}