-
Notifications
You must be signed in to change notification settings - Fork 0
Fuse
Malexion edited this page Oct 31, 2016
·
1 revision
-
obj1
Target item for fusion. -
obj2
Item to fuse into first item. -
[options]
[Optional] Object with 3 possible params,{ deep: false, all: false, handler: (x) => { return x; } }
var result = __.fuse({
foo: 'bar',
sub: {
target: 3
}
}, {
foo: 'fish',
sub: 2
});
console.log(result);
result = __.fuse({
foo: 'bar',
sub: {
target: 3
}
}, {
foo: 'fish',
sub: 2
}, { deep: true });
console.log(result);
// Handler example
__.fuse({}, {}, {
deep: true,
handler: (data, event) => {
if(data.value instanceOf MyPayloadClass) {
event.skip = true; // Prevent default handling of object, prevents deep iterator from going over it
return data.value.getPayload(); // Return what we want the value to be and move on
}
return data.value;
}
});
- Home
- String Prototype Functions
- Replace All
- Replace While
- Format
- Contains
- Whiteout
- Capitalize
- First Word
- Truncate
- Base Functions
- All
- Class
- Contains
- Count
- Debounce
- Deep All
- Distinct
- Enum
- First
- Filter
- Fuse
- Get Type
- Group
- Index
- Intersect
- Last
- Map
- Match
- Move
- Options
- Get Property
- Rank
- Remove
- Remove At
- Scope
- Search
- Sort
- Switch
- Throttle
- Formats
- Pad Left
- Pad Right
- Type Detection
- Defined
- Set
- Same Type
- Function
- Object
- Array
- Arguments
- Boolean
- String
- Number
- Date
- Null
- Undefined
- NaN
- Math
- Random 16-bit
- Round To
- Round Down To
- Round Up To
- Median
- Sum
- Average
- Max
- Min
- Between
- Percentage
- Generators
- Guid
- Password
- Classes
- Overwrite
- Updatable