Comparing ES7 and core.async
ES7 | core.async |
---|---|
async function() {...} |
(fn [] (go ...)) |
await ... |
(<! ...) |
await* or Promise.all(...) |
(doseq [c ...] (<! c)) |
<?php | |
// apitest.php | |
// by Karl Kranich - karl.kranich.org | |
// version 3.1 - edited query section | |
require_once realpath(dirname(__FILE__) . '/vendor/autoload.php'); | |
include_once "google-api-php-client/examples/templates/base.php"; | |
$client = new Google_Client(); |
ES7 | core.async |
---|---|
async function() {...} |
(fn [] (go ...)) |
await ... |
(<! ...) |
await* or Promise.all(...) |
(doseq [c ...] (<! c)) |
#!/usr/bin/env bash | |
#! top-of-file comments can be written using more #! lines, which | |
#! is a valid comment in both clojure and bash | |
":";# alternately this works too | |
#! The construction below uses cross-language syntactic hackery to | |
#! specify the -Sdeps arg in a part of the file that's interpreted | |
#! by clojure as clojure syntax (i.e., not a line comment), so it |
(ns cognician.db.translate | |
(:require [datomic.api :as d]) | |
(:import [clojure.lang MapEntry] | |
[datomic.query EntityMap])) | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;; Language | |
(def default-language :en-GB) |
<html> | |
<head> | |
<title>Test</title> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> | |
<script src="http://fb.me/react-0.5.1.js"></script> | |
<script src="http://fb.me/JSXTransformer-0.5.1.js"></script> | |
</head> |
(ns n01se.externs-for-cljs | |
(:require [clojure.java.io :as io] | |
[cljs.compiler :as comp] | |
[cljs.analyzer :as ana])) | |
(defn read-file [file] | |
(let [eof (Object.)] | |
(with-open [stream (clojure.lang.LineNumberingPushbackReader. (io/reader file))] | |
(vec (take-while #(not= % eof) | |
(repeatedly #(read stream false eof))))))) |
Based heavily on [s3-beam][1], but uses re-frame events/subs to get the job done. The /sign
handler is the [s3-beam][1] handler (near verbatim).
For background on (ui.core/component "...")
see https://opensourcery.co.za/2017/02/12/using-semantic-ui-react-with-re-frame/
ui.ajax
is just thin wrappers and/or aliases around plumbing from ajax.core
from cljs-http
{:deps | |
{org.clojure/clojure {:mvn/version "1.9.0"} | |
com.datomic/datomic-free {:mvn/version "0.9.5697"}}} |
<?php | |
namespace HelloWorld; | |
use InvalidArgumentException; | |
/** | |
* This class is somewhere in your library | |
* @Entity | |
* @Table(name="users") | |
*/ |
(ns cljs-made-easy.core | |
(:refer-clojure :exclude [into]) | |
(:require-macros [cljs.core.async.macros :refer [go go-loop]]) | |
(:require [cljs.core.async :refer [<! >!] :as a])) | |
(enable-console-print!) | |
(defn resolving-promise [key t reject] | |
(go | |
(pr (str key " starting")) |