found a snippet similar to sanityinc's, works for current.

LesleyLai/recompile-on-save.el:
https://gist.github.com/LesleyLai/627085e275d2cf46429c0f44c27a92d7

```lisp
(defun recompile-elc-on-save ()
  "If you're saving an elisp file, likely the .elc is no longer valid."
  (make-local-variable 'after-save-hook)
  (add-hook 'after-save-hook
            (lambda ()
              (if (file-exists-p (byte-compile-dest-file buffer-file-name))
                  (byte-compile-file buffer-file-name)))))
(add-hook 'emacs-lisp-mode-hook 'recompile-elc-on-save
          )
```