clay / amphora

Middleware for Express that composes components into renderable pages
https://claycms.gitbooks.io/amphora/
MIT License
31 stars 23 forks source link

initPlugins parameters object #652

Open james-owen opened 5 years ago

james-owen commented 5 years ago

Is your feature request related to a problem? Please describe.

When initializing plugins, occasionally several arguments are needed, which makes for too many arguments being passed to a single function.

Describe the solution you'd like

The function initPlugins in plugins.js should pass an object to each plugin.

Current: plugin(router, pluginDBAdapter, publish, sites)

Suggested: plugin(router, paramsObject)

james-owen commented 5 years ago

Pull request to add a 5th parameter to this function #655

james-owen commented 5 years ago

@PedroAlbR Considering getting the params object started now, while we're working with plugins and potentially adding more params. The params would look like this: plugin(router, pluginDBAdapter, publish, sites, paramsObj) instead of the current: plugin(router, pluginDBAdapter, publish, sites, site, [additional params])