Commit efb0813f authored by Ricardo J. Mendez's avatar Ricardo J. Mendez

docstring clean-up and improvements

parent a42b402b
Pipeline #9701643 passed with stage
in 1 minute and 25 seconds
......@@ -9,12 +9,15 @@
;;;; can just have a separate namespace for data transformations
(defn save-raw
"Saves the data raw, without converting it to transit first."
"Saves the data raw, without converting it to transit first. Will pass
the optional callback function it receives to storage/set for notification
when the operation has completed."
[id data callback]
(storage/set {id data} storage/local callback))
(defn save
"Saves our data on the extension's storage after converting it to transit."
"Saves our data on the extension's storage after converting it to transit.
Can optionally receive a callback function for when storage/set completes."
([id data]
(save id data nil))
([id data callback]
......
......@@ -41,7 +41,7 @@
(defn migrate-to-latest
"Takes a data set and interates on it until no more version migrations can be applied"
"Takes a data set and iterates on it until no more version migrations can be applied"
[data]
(loop [to-migrate data]
(let [migrated (migrate to-migrate)]
......
......@@ -15,7 +15,8 @@
;;;;------------------------------------
(defn time-score
"Returns a score for a tab based on the total time spent at both URLs and sites"
"Returns a score for a tab based on the total time spent at both a URL and
the site the URL belongs to."
[tab url-times site-times settings]
(let [url (:url tab)
idx (:index tab)
......
......@@ -87,7 +87,8 @@
0))
(defn to-string-set
"Split a string into a string set using commas, semi-colons or new lines, and returns it as a set"
"Split a string using commas, semi-colons or new lines, trims the resulting
elements, and returns them as a set"
[s]
(->>
(string/split (or s "") #",|\n|;| ")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment