Skip to content

mdefaux/minwrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Min Wrap

Minimal Wrapper for DOM

Synopsis

A collection of utility classes and methods for managing DOM objects and create a minimal support for creating a single-page application. DOM objects are created and wrapped in an utility class that provide methods with uniform syntax style and convention.

Example

<body>
  <div class='my-class' />
</body>

Traditional:

let dom = document.querySelector('.my-class');
if( !dom )
  throw new Error('Not found.');
wrapper.onclick= function(evt) 
{
    show();
};

Using minwrap:

let wrapper = $select('.my-class'); // implicit assertion of object found
wrapper.onClick( (evt) => // uses camel case syntax with onClick
{
    show();
});

About

Minimal Wrapper for DOM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published