Skip to content

How to unregister onShow/onClose passed in init? #546

@GiuseppePiscopoHypex

Description

@GiuseppePiscopoHypex

Hi

not sure if it is ok to post questions/doubts here. Please point me to a better suited place if that's the case. Quite new to this library, thanks for maintaining it.

I was wondering: in init(config) I pass some functions as onShow and onClose handlers. Those function keep references on some object instance I'd like to release at some point. Is there any way I can unregister what has been passed in init()? I checked init() return type but is void.

Ideally there could be some return value shaped like (pardon naming):

type InitUnsubscribe = {
    removeOnShow: () => void;
    removeOnClose: () => void;
};

So that one stores a references to that return value, and later on call returnValue.removeOnShow() to remove one of the listeners. Basically for each one of the couple there should be its own unsubscribe/unregister/removeListener function (where removeListener would be the least preferable).

Ok, apart from my wandering, is it possibile to unregister those as of today?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions