jart

Check if value has changed. Callback function when changed.

Usage no npm install needed!

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

README

Jart

changeChecker(initValue)(nextValue)

Give it an initial value. Returns function that will be true when value changed.

handleChanges(getValue, onChange)()

Useful for redux style environments. Give it a getter func and an onChange callback. It will return a function. Call returned func on every change and it will conditionally calling onChange.