Getting started with Trap.apex
Bulk Object
A bulk object represents a trunk of SObjects to be processed in the trigger. Bulk objects define the scope that you can work on the data. By default, they provide data as encapsulated streams, newStream
for new SObjects and oldStream
for old SObjects.
bulkObj.oldStream
.tap(R.debug.apply('Old objects: '))
.subscribe(new CustomFunc());
You can access to the old/new SObject if you are already in one stream.
bulkObj.newStream
.filter((Func)R.pipe.run(
Trap.F.getOld,
new CustomFilterFunc()
))
.subscribe(new CustomFunc());