Closed nozavroni closed 6 years ago
I find myself doing this a lot:
$collection->fold(function($col, $val, $key, $i) { return $col->whatever(); }, new Collection);
It might be useful to add a method like this:
$collection->cfold(function(Collection $col, $val, $key, $i) { return $col->whatever(); });
Not a huge difference I know, but having that new Collection at the end just feels very clunky. Maybe there's an even better way to accomplish the same thing. Think about it.
This is in the wrong repository. Should have been posted here: https://github.com/nozavroni/collect
I find myself doing this a lot:
It might be useful to add a method like this:
Not a huge difference I know, but having that new Collection at the end just feels very clunky. Maybe there's an even better way to accomplish the same thing. Think about it.