would unsubscribe from _callbackA, while leaving _callbackB in tact. However, when inspecting the code, no matter what, all listeners are deleted (foundation.core.js, function unsubscribe):
delete listeners[name];
If a developer adds listeners to a modal, then later unsubscribes from them, the internal modal's listener is removed, causing that modal to stop working.
You can
subscribe
to the same event multiple times without issue:Internally (in
foundation.core.js, function subscribe
), this adds the callbacks to alisteners
array:It's implied in #806 that unsubscribing in this manner:
would unsubscribe from
_callbackA
, while leaving_callbackB
in tact. However, when inspecting the code, no matter what, all listeners are deleted (foundation.core.js, function unsubscribe
):If a developer adds listeners to a modal, then later unsubscribes from them, the internal modal's listener is removed, causing that modal to stop working.