Permalink
Browse files

add core.async to mori

  • Loading branch information...
jcouyang committed Jul 29, 2015
1 parent 1aa54c5 commit aaf843d3a1c8cf97ff8d453242fe5ea4a213a9e2
Showing with 682 additions and 479 deletions.
  1. +618 −474 mori.js
  2. +6 −3 project.clj
  3. +1 −0 scripts/build.sh
  4. +1 −0 spec/.tern-port
  5. +13 −1 spec/mori-spec.js
  6. +42 −0 src/mori/core.async.cljs
  7. +1 −1 support/wrapper.end.txt
1,092 mori.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,8 +1,9 @@
(defproject mori "0.5.0-SNAPSHOT"
:description "Persistent Data Structures for JavaScript"
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-3178"]]
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "0.0-3308"]
[org.clojure/core.async "0.1.346.0-17112a-alpha"]]
:plugins [[lein-cljsbuild "1.0.5"]]
@@ -35,4 +36,6 @@
:mutable {:entries #{mori.mutable}
:output-to "release/build/mori.mutable.js"}
:extra {:entries #{clojure.data cljs.reader clojure.set mori.extra}
:output-to "release/build/mori.extra.js"}}}}]})
:output-to "release/build/mori.extra.js"}
:core.async {:entries #{cljs.core.async mori.async}
:output-to "release/build/mori.async.js"}}}}]})
@@ -11,6 +11,7 @@ echo "Finalizing mori.js"
cat ./release/build/mori.base.js;
cat ./release/build/mori.extra.js;
cat ./release/build/mori.mutable.js;
cat ./release/build/mori.async.js;
cat support/wrapper.end.txt) > mori.js
echo "Build finished."
@@ -0,0 +1 @@
49930
@@ -186,6 +186,18 @@ describe("Mori Extra", function() {
expect(bigFib).toEqual(Infinity);
});
});
describe('channels', function() {
it('create channel with size',function(done) {
var a = mori.async;
var c = a.chan(1)
a.take$(c ,function(x){
expect(x).toBe('something in channel')
done()
})
a.put$(c, 'something in channel',function() {
})
})
})
})
@@ -0,0 +1,42 @@
(ns mori.async
(:refer-clojure :exclude [reduce into merge map take partition partition-by])
(:require-macros
[mori.macros :refer [mori-export make-inspectable]])
(:require [cljs.core.async :as async]))
(mori-export async.chan async/chan)
(mori-export async.toChan async/to-chan)
(mori-export async.ontoChan async/onto-chan)
(mori-export async.take$ async/take!)
(mori-export async.put$ async/put!)
(mori-export async.timeout async/timeout)
(mori-export async.promiseChan async/promise-chan)
(mori-export async.close$ async/close!)
(mori-export async.pipelineAync async/pipeline-async)
(mori-export async.pipeline async/pipeline)
(mori-export async.pipe async/pipe)
(mori-export async.into async/into)
(mori-export async.split async/split)
(mori-export async.reduce async/reduce)
(mori-export async.merge async/merge)
(mori-export async.map async/map)
(mori-export async.take async/take)
(mori-export async.partition async/partition)
(mori-export async.partitionBy async/partition-by)
(mori-export async.doAlts async/do-alts)
(mori-export async.offer$ async/offer!)
(mori-export async.pull$ async/poll!)
(mori-export async.pub async/pub)
(mori-export async.sub async/sub)
(mori-export async.unsub async/unsub)
(mori-export async.unsubAll async/unsub-all)
(mori-export async.mult async/mult)
(mori-export async.tap async/tap)
(mori-export async.untap async/untap)
(mori-export async.untapAll async/untap-all)
(mori-export async.mix async/mix)
(mori-export async.admix async/admix)
(mori-export async.unmix async/unmix)
(mori-export async.unmixAll async/unmix-all)
(mori-export async.toggle async/toggle)
(mori-export async.soloMode async/solo-mode)
@@ -1 +1 @@
;return this.mori;}.call({});});
;return this.mori;}.call(this);});

0 comments on commit aaf843d

Please sign in to comment.