Skip to content

Commit

Permalink
add delay! id! repeat! unix-time! ; bump 0.1.0-a3
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Dec 14, 2018
1 parent 64bca2a commit d8f5ae1
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Cumulo Util (WIP)
[![Clojars Project](https://img.shields.io/clojars/v/cumulo/util.svg)](https://clojars.org/cumulo/util)

```edn
[cumulo/util "0.1.1-a2"]
[cumulo/util "0.1.1-a3"]
```

```clojure
Expand Down
100 changes: 100 additions & 0 deletions calcit.edn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meyvn.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{:pom {:group-id "cumulo",
:artifact-id "util",
:version "0.1.1-a2",
:version "0.1.1-a3",
:name "Util functions for Cumulo projects"}
:packaging {:jar {:enabled true
:remote-repository {:id "clojars"
Expand Down
10 changes: 9 additions & 1 deletion src/cumulo_util/core.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

(ns cumulo-util.core )
(ns cumulo-util.core (:require ["shortid" :as shortid]))

(defn delay! [duration task] (js/setTimeout task duration))

(defn find-first [f xs] (reduce (fn [_ x] (when (f x) (reduced x))) nil xs))

(defn get-env! [property] (aget (.-env js/process) property))

(defn id! [] (.generate shortid))

(defn repeat! [duration task] (js/setInterval task duration))

(defn unix-time! [] (.valueOf (js/Date.)))

0 comments on commit d8f5ae1

Please sign in to comment.