whenjs

A Simple 'when' function for both node and the browser

Usage no npm install needed!

<script type="module">
  import whenjs from 'https://cdn.skypack.dev/whenjs';
</script>

README

When.js

A simple library for 'when' loops

Usage

var when = require("whenjs")

// Later

when(function(){
    return true == true; // The Condition.
}, function(){
    alert("True == True!"); // When The Condition Is True
})

It Will Work In The Browser Too!

Simply download when.js, then include <script src="when.js" type="text/javascript"></script>"