Skip to content

Conversation

@BobMakhlin
Copy link
Contributor

@BobMakhlin BobMakhlin commented Oct 28, 2025

This update extends the id property in NotificationsOptions from number to string | number.
It allows applications that use string-based identifiers (such as UUIDs, database keys, or prefixed IDs) to manage notifications programmatically without type casting or conversion.

Rationale:

  • Some applications naturally use string IDs for entities and notifications.
  • The current numeric-only type requires unnecessary conversions and limits flexibility.
  • The internal implementation only compares IDs via strict equality (===), so supporting both types introduces no behavior change or compatibility issues.

Impact:
✅ Backward-compatible: existing numeric IDs continue to work.
✅ No runtime logic changes: ID handling remains equality-based.
✅ Documentation updated accordingly.

Example usage:

notify({ id: 123, text: 'Numeric ID example' });
notify({ id: 'uuid-123', text: 'String ID example' });
notify.close('uuid-123');

@kyvg

@BobMakhlin BobMakhlin force-pushed the feat/string-id-support branch from 74a2a86 to 9435ed8 Compare October 28, 2025 21:46
@BobMakhlin BobMakhlin changed the title feat(notifications): allow string | number ids in NotificationsOptions Allow string | number ids in NotificationsOptions Oct 28, 2025
@BobMakhlin BobMakhlin force-pushed the feat/string-id-support branch from 9435ed8 to dc67aea Compare October 28, 2025 21:48
@kyvg kyvg merged commit 0f5e0eb into kyvg:master Oct 29, 2025
@kyvg
Copy link
Owner

kyvg commented Oct 29, 2025

Hi @BobMakhlin, thank you for your pull request! I've already published your changes in 3.4.2 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants