Code Monkey home page Code Monkey logo

emem's Introduction

+-++-++-++-+
|e||m||e||m|
+-++-++-++-+

Development Status

Currently seeking feedback from the community.

Use Case

Another JavaScript library or developer's code blows elements out the DOM accidently leaving event handlers behind with references to the removed elements causing memory leaks. You are running mulitple versions of the same JavaScript library, possibly to support legacy code, and memory is leaking because each version has references to some of the same elements.

Solution

Emem provides the ability to view event handlers from various JavaScript libraries and identifies those attached to orphaned elements.

API

This API will likely change. I am currently seeking feedback from the community as to whether emem is even useful and if useful what features would be most beneficial.

emem.conf()

Sets the libraries to be examined. The alias names are assumed to be attached to window. Eventually a string representation of the library location or a direct reference to the library will be accepted.

emem.conf({
	libs : {
		jQuery: { versions: ['jq16', 'jq17']}                         
	}
});

###emem.garbage() Returns references to event handlers for all orphaned elements. Filtering by library and version, and a verbose mode could be added in the future if a need is expressed by the community.

###emem.release() Destroys event handlers attached to orphaned elements. A more granular destruction could be added by passing in a reference to the event handler to be deleted. For instance, one could examine the results from emem.garabage() and cherry pick objects to be deleted.

emem's People

Contributors

jstrimpel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

emem's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.