13 Matching Annotations
  1. Dec 2023
  2. Feb 2023
  3. Jul 2022
  4. May 2022
    1. In order to execute an event listener (or any function for that matter) after the user stops typing, we need to know about the two built-in JavaScript methods setTimeout(callback, milliseconds) and clearTimeout(timeout): setTimeout is a JavaScript method that executes a provided function after a specified amount of time (in milliseconds). clearTimeout is a related method that can be used to cancel a timeout that has been queued.

      Step 1. Listen for User Input

      <input type="text" id="my-input" />

      let input = document.querySelector('#my-input'); input.addEventListener('keyup', function (e) { console.log('Value:', input.value); })

      Step2: Debounce Event Handler Function

      let input = document.getElementById('my-input'); let timeout = null;

      input.addEventListener('keyup', function(e) { clearTimeout(timeout);

      timeout = setTimeout(function() { console.llog('Input Value:', textInput.value); }, 1000); })

  5. Sep 2020
  6. Jun 2020
  7. Feb 2020
    1. Don't wait Don’t wait. When you have something of value like a potential blog post or a small fix implement it straight away. Right now everything is fresh in your head and you have the motivation, inspiration is perishable. Don’t wait until you have a better version. Don’t wait until you record a better video. Don’t wait for an event (like Contribute). Inventory that isn’t released is a liability since it has to be managed, gets outdated, and you miss out on the feedback you get when you would have implemented it straight away.
    2. Cleanup over sign-off As discussed in Sid's interview on iteration, waiting for approval can slow things down. We can prevent this with automation (e.g. tests of database migration performance) or clean-up after the fact (refactor a Pajamas if something was added that isn't coherent), but we try to ensure people don't need to wait for signoff.
  8. Apr 2019
  9. Dec 2017