django-elm icon indicating copy to clipboard operation
django-elm copied to clipboard

Add handlers for destroy and update

Open Confidenceman02 opened this issue 8 months ago • 0 comments

Not sure how useful these will be but it would be handy to provide handlers for the update and destroy lifecycles that defo provides.

        return {
            // Called whenever the value of the `djelm` attribute changes
            update: (newData, oldData) => {},
            // Called when the element (or its djelm attribute) is removed from the DOM
            destroy: () => {},
        };

The destroy lifecycle would be called when the elm runtime takes over the element that's used for the program because that is the program defo is listening for to load the program.

The update function is called when the data changes, however once the Elm runtime takes over the element it wouldn't be updating anymore.

Confidenceman02 avatar Apr 20 '25 06:04 Confidenceman02