Budibase / svelte-ag-grid

A svelte wrapper component around ag-grid
MIT License
25 stars 14 forks source link

Should `grid` be destroyed? #2

Closed roydukkey closed 3 years ago

roydukkey commented 3 years ago

destroy() Will destroy the grid and release resources. If you are using Angular (version 1 or 2) you do not need to call this, as the grid links in with the AngularJS 1.x lifecycle. However if you are using Web Components or native Javascript, you do need to call this, to avoid a memory leak in your application.

ref: https://www.ag-grid.com/javascript-grid-api/

The grid is created on mount, likewise then, shouldn't it be destroyed when the svelte component is destroyed?

  onDestroy(() => {
    if (grid) {
      grid.destroy();
    }
  });
shogunpurple commented 3 years ago

Closed by https://github.com/Budibase/svelte-ag-grid/pull/5