Skip to content

Add PagedConfig handlers property

Boris Budini requested to merge feature/polyfill-handlers into master

It changes 3 things:

  • registering handlers from within the config object
  • register handlers as bare objects (as long as the property name matches a hook)
  • register a config object after a polyfill script

Config is now scoped to the instance of the Polyfill, and it is taken in account when DOMContentReady is fired. Config is simpler because we don't have to use 2 different concepts (config object, and registering classes).

Before we would have to use 3 scripts (config object, script src, then Handler classes with manual preview call).

I did some extra stuff:

  • removed explicit dependency to lodash because it's not imported by paged.js
  • moved tests to the src folder so as they mimic the structure of the specs one.

Let me know if you have questions, or would like me to change something.

This work has been done during Les Rencontres de Lure, with @JulieBlanc sitting next to me!

Edited by Boris Budini

Merge request reports