0.0.0 • Published 9 months ago

snowflake v0.0.0

Weekly downloads
51
License
MIT
Repository
-
Last release
9 months ago

Snowflake

Run code in particular circumstances

What is Snowflake?

Snowflake lets you run a piece of code once, or every so often. It is useful for debugging a function that is run frequently.

<script type="text/javascript" src="snowflake.js"></script>
<script type="text/javascript">
  var problemFn = function() {
    var interestingVar = 0;

    // print out interestingVar once, even though problemFn is run more than once
    snowflake.once(function() {
      console.log(interestingVar);
    });

    // print out interestingVar every two seconds
    snowflake.every(function() {
      console.log(interestingVar);
    }, 2000);

    interestingVar++;
  };

  while(true) {
    problemFn();
  };
</script>

Get the code

0.0.0

9 months ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago