Closed evolross closed 2 days ago
Figured it by finding this down in the Svelte code. Though not well documented, you can simply access a notice's attributes directly, like so:
stack.forEach(function(notice) {
// Access to notice options like...
notice.type === ...;
notice.title === ...;
notice.text === ...;
});
In the older versions of PNotify you could call...
...in order to do comparisons of existing notices. We used a pattern like the above to make a
createSingletonNotification()
function.Calling
stack.forEach(function(notice) {...})
returns thenotices
but they now have limited functions for accessing their options.Why has all this been removed from the API? For some odd reason, it seems like all we get is a way to check a notice's DOM containers which don't even have unique
ids
but just the same classes which requires getting them from the DOM manually and doing a bunch of work to theirtype
,title
, etc.