{"version":"2.1.265","anchor":"hook-registration-duplicate-once-only-event-registration-no","canonical_anchor":"hook-registration-duplicate-once-only-event-registration-no","heading":"Hook registration: duplicate once-only event registration now throws, and pattern-based event names supported","tier":"use","area":"Hooks","scope":null,"heads_up":null,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.265\/e\/hook-registration-duplicate-once-only-event-registration-no","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.265","markdown":"### Hook registration: duplicate once-only event registration now throws, and pattern-based event names supported\n\nHook registration now rejects registering the same once-only event twice and validates names as patterns\n\n**What**\n\nWhen a hook (custom code that runs on a specific event) is registered with `on(event, ...)`, event names are now validated as patterns rather than plain names. Registering the same once-only event more than once now throws an error reading \"registered twice.\" Error messages for hook registration also now refer to a 'pattern' instead of an 'event' in their wording.\n\n**Why**\n\nThis catches a mistake, accidentally registering the same one-time hook event twice, that previously could pass silently, and the wording change reflects that event names are now matched as patterns rather than exact strings.\n\n- Area: Hooks\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5"}