     (delq! location doom-store-persist-alist 'assoc)))
 
 (defun doom--store-init (location)
+  (cl-check-type location (or null string))
   (or (gethash location doom--store-table)
       (let* ((file-name-handler-alist nil)
              (location-path (expand-file-name location doom-store-dir)))

`doom-store-dir'). One file may contain multiple cache entries.")

(defvar doom--store-table (make-hash-table :test 'equal))
(defvar doom--inhibit-flush nil)

(defun doom-save-persistent-store-h ()
  "Hook to run when an Emacs session is killed. Saves all persisted variables
listed in `doom-store-persist-alist' to files."
  (let (locations)
    (let ((doom--inhibit-flush t))
      (dolist (alist (butlast doom-store-persist-alist 1))
        (cl-loop with location = (car alist)
                 for var in (cdr alist)
                 do (doom-store-put var (symbol-value var) nil location)
                 and do (cl-pushnew location locations))))
    (mapc #'doom--store-flush locations)))
(add-hook 'kill-emacs-hook #'doom-save-persistent-store-h)


(defvar doom-store-dir (concat doom-etc-dir "store/")
  "Directory to look for and store data accessed through this API.")

(defvar doom-store-persist-alist ()
  "An alist of alists, containing lists of variables for the doom cache library
to persist across Emacs sessions.")

