MCPcopy
hub / github.com/rikschennink/fitty / destroy

Function destroy

src/fitty.js:187–198  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

185 };
186
187 const destroy = (f) => () => {
188 // remove from fitties array
189 fitties = fitties.filter((_) => _.element !== f.element);
190
191 // stop observing DOM
192 if (f.observeMutations) f.observer.disconnect();
193
194 // reset the CSS properties we changes
195 f.element.style.whiteSpace = f.originalStyle.whiteSpace;
196 f.element.style.display = f.originalStyle.display;
197 f.element.style.fontSize = f.originalStyle.fontSize;
198 };
199
200 // add a new fitty, does not redraw said fitty
201 const subscribe = (f) => () => {

Callers 1

fittyCreateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…