elpete / CFCollection

An array wrapper for functional programming
MIT License
6 stars 6 forks source link

Leverage WireBox Mixins to provide custom collection functions #9

Closed elpete closed 6 years ago

elpete commented 6 years ago

WireBox allows mixing in of methods into a component. We can leverage this to mix in arbitrary new collection methods when loading the module. Think of it like the static macros available in Lucee 5 already.

Here’s how I envision it: add a custom setting macrosLocation which takes a string, list, or array of locations. Then, in ModuleConfig.cfc@onLoad mix in those locations to the mapping for Collection.

(This would obviously only be an automatic feature for ColdBox users.)

Don’t forget to add the feature to the README.

As far as testing goes, we could pull in the integration testing scaffolding from cb-module-template so we can test the entire module lifecycle (including onLoad). I’m happy to help with that, if needed.

elpete commented 6 years ago

Added in v3.3.0