This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Extension function for Spring-Data's CrudRepository providing a convenient wrapper to handle pagination in a Kotlin-idiomatic way. | |
* | |
* Creates a Sequence using Page and Pageable to iterate calls to a paginated Spring-Data function call. | |
* | |
* Example usage: | |
* | |
* myPagingAndSortingRepository.paginate(50) { pageable -> | |
* // directly call any function on the repository that returns a Page | |
* findAll(pageable) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wrapLastParamInCLSBind = function(clsns, container, functionName) { | |
shimmer.wrap(container, functionName, function (original) { | |
return function() { | |
var lastArg = arguments[arguments.length - 1]; | |
if (lastArg && ('function' == typeof lastArg)) { | |
var clsBoundLastArg = clsns.bind(lastArg); | |
arguments[arguments.length - 1] = clsBoundLastArg; | |
} |