alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.17k stars 320 forks source link

Add callback to respond to errors when a component does not initialise in `initAll` #5267

Closed romaricpascal closed 2 weeks ago

romaricpascal commented 1 month ago

What

Add a onError option within the config object that initAll can receive to allows the caller to pass a callback function that'll be called if an error happens while initialising a component.

Why

Once the feature is added to createAll in #5212, initAll should offer the same functionality for consistency

Who needs to work on this

Developers

Who needs to review this

Developers

Done when