DEV Community

Cover image for Monster 1.31 released
Volker Schukai for schukai GmbH

Posted on

3 2

Monster 1.31 released

Today we released the latest edition of our Monster project. Monster is a collection of javascript classes that we need for daily work in our web projects.

Besides small helper functions and classes, it also provides useful functions to enable reactive programming.

Monster is available via jsdelivr and npm.

Only the highlights are described here. The full functionality can be found in the documentation.

document and window ready

With jQuery there was always a simple call to check if the document was already loaded.

$( document ).ready(function() {
  // Handler for .ready() called.
});
Enter fullscreen mode Exit fullscreen mode

But with vanilla you always have to listen for events or query the document ready status. So we have that in our lib too there are two new promises.

domReady.then(()=>{
    // do something
}).catch(e => done(e));
Enter fullscreen mode Exit fullscreen mode

and ...

windowReady.then(()=>{
    // do something
}).catch(e => done(e));
Enter fullscreen mode Exit fullscreen mode

hope you enjoy it!

References

Top comments (0)

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay