CrossClj

0.1.1 docs

SourceDocs



RECENT

    aramis

    Clojars

    Jan 30, 2018


    OWNER
    Magnet
    info@magnet.coop
    www.magnet.coop

    Readme

    Index of all namespaces


    « Project + dependencies

    A library providing a Promise.all()-like capabilities for re-frame.

    cljs.core — cljsDocsSource

    VARS

    - * *1 *2 *3 + - / < <= = == > >=

    A *assert* ->ArrayChunk ->ArrayIter ->ArrayList ->ArrayNode ->ArrayNodeIterator ->ArrayNodeSeq ->Atom accumulating-seq-count aclone add-to-string-hash-cache add-watch aget alength alter-meta! ancestors any? APersistentVector apply apply-to apply-to-simple array array->transient-hash-map array-chunk array-copy array-copy-downward array-extend-kv array-for array-index-of array-index-of-equiv? array-index-of-identical? array-index-of-keyword? array-index-of-nil? array-index-of-symbol? array-iter array-list array-map array-map-extend-kv array-map-index-of array-reduce array-seq array? ArrayChunk ArrayIter ArrayList ArrayNode ArrayNodeIterator ArrayNodeSeq ASeq aset assoc assoc! assoc-in associative? atom Atom

    B ->BitmapIndexedNode ->BlackNode ->Box balance-left balance-left-del balance-right balance-right-del bit-and bit-and-not bit-clear bit-count bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-shift-right-zero-fill bit-test bit-xor bitmap-indexed-node-index BitmapIndexedNode bitpos BlackNode boolean boolean? booleans bounded-count Box build-subvec butlast byte bytes

    C *clojurescript-version* *command-line-args* ->ChunkBuffer ->ChunkedCons ->ChunkedSeq ->Cons cat char char-escapes char? CHAR_MAP chars checked-aget checked-aget' checked-aset checked-aset' chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest ChunkBuffer chunked-seq chunked-seq? ChunkedCons ChunkedSeq chunkIteratorSeq ci-reduce clj->js clone clone-and-set cloneable? coll? comp comparator compare compare-and-set! compare-indexed compare-keywords compare-symbols complement completing concat conj conj! cons Cons constantly contains? count counted? create-array-node-seq create-inode-seq create-node create-ns create-tree-map-seq cycle

    D ->Delay dec dedupe default-dispatch-val Delay delay? demunge demunge-pattern demunge-str DEMUNGE_MAP DEMUNGE_PATTERN deref derive descendants disj disj! dispatch-fn dissoc dissoc! distinct distinct? divide do-assoc doall dominates dorun double double-array double? doubles drop drop-last drop-while

    E *e ->Eduction ->Empty ->EmptyList ->ES6EntriesIterator ->ES6Iterator ->ES6IteratorSeq ->ES6SetEntriesIterator edit-and-set eduction Eduction empty Empty EMPTY empty-ordered-hash empty-unordered-hash empty? EmptyList enable-console-print! ensure-reduced equiv-map equiv-sequential es6-entries-iterator es6-iterator es6-iterator-seq es6-set-entries-iterator ES6EntriesIterator ES6Iterator ES6IteratorSeq ES6SetEntriesIterator even? every-pred every? ex-cause ex-data ex-info ex-message ExceptionInfo extend-object!

    F *flush-on-newline* false? ffirst filter filterv find find-and-cache-best-method find-macros-ns find-ns find-ns-obj find-ns-obj* first first-array-for-longvec fix fixture1 fixture2 flatten flatten1 float float? floats flush Fn fn->comparator fn? fnext fnil force frequencies

    G -global-hierarchy gensym gensym_counter get get-global-hierarchy get-in get-method get-validator group-by

    H ->HashCollisionNode ->HashMapIter ->HashSetIter halt-when hash hash-coll hash-collision-node-find-index hash-combine hash-imap hash-iset hash-keyword hash-map hash-ordered-coll hash-set hash-string hash-string* hash-symbol hash-unordered-coll HashCollisionNode HashMapIter HashSetIter

    I ->IndexedSeq ->IndexedSeqIterator -indexOf IAssociative IAtom IChunk IChunkedNext IChunkedSeq ICloneable ICollection IComparable ICounted ident? identical? identity IDeref IDerefWithTimeout IEditableCollection IEmptyableCollection IEncodeClojure IEncodeJS IEquiv IFind ifind? IFn ifn? IHash IIndexed IIterable IKVReduce IList ILookup IMap IMapEntry IMeta imul IMultiFn INamed inc indexed? IndexedSeq IndexedSeqIterator INext infinite? INIT inode-kv-reduce Inst inst-ms inst? instance? int int-array int-rotate-left int? integer? interleave interpose into into-array ints IPending IPrintWithWriter IRecord IReduce IReset IReversible is_proto_ isa? ISeq ISeqable ISequential ISet ISorted IStack ISwap iter iter-reduce ITER_SYMBOL iterable? iterate ITransientAssociative ITransientCollection ITransientMap ITransientSet ITransientVector IUUID IVector IVolatile IWatchable IWithMeta IWriter

    J js->clj js-delete js-invoke js-keys js-mod js-obj js-reserved js-reserved-arr js-reserved? juxt

    K ->KeySeq ->Keyword keep keep-indexed key key->js key-test keys KeySeq Keyword keyword keyword-identical? keyword?

    L *loaded-libs* ->LazySeq ->List -lastIndexOf last LazySeq lift-ns linear-traversal-nth list List list* list? load-file long long-array longs lookup-sentinel

    M *main-cli-fn* ->Many ->MapEntry ->MetaFn ->MultiFn ->MultiIterator m3-C1 m3-C2 m3-fmix m3-hash-int m3-hash-unencoded-chars m3-mix-H1 m3-mix-K1 m3-seed make-array make-hierarchy Many map map-indexed map? mapcat MapEntry mapv mask max max-key maybe-warn memoize merge merge-with meta MetaFn methods min min-key missing-protocol mix-collection-hash mk-bound-fn mod MODULE_INFOS MODULE_URIS MultiFn MultiIterator munge munge-str

    N *ns* ->Namespace ->NeverEquiv ->NodeIterator ->NodeSeq name namespace Namespace nat-int? native-satisfies? neg-int? neg? never-equiv NeverEquiv new-path newline next nfirst nil-iter nil? nnext NodeIterator NodeSeq NONE not not-any? not-empty not-every? not-native not= ns-interns* ns-lookup ns-name NS_CACHE nth nthnext nthrest number?

    O *out* ->ObjMap obj-clone obj-map obj-map->hash-map obj-map-compare-keys object-array object? ObjMap odd?

    P *print-dup* *print-err-fn* *print-fn* *print-fn-bodies* *print-length* *print-level* *print-meta* *print-namespace-maps* *print-newline* *print-readably* ->PersistentArrayMap ->PersistentArrayMapIterator ->PersistentArrayMapSeq ->PersistentHashMap ->PersistentHashSet ->PersistentQueue ->PersistentQueueIter ->PersistentQueueSeq ->PersistentTreeMap ->PersistentTreeMapSeq ->PersistentTreeSet ->PersistentVector pack-array-node parents partial partition partition-all partition-by peek persistent! persistent-array-map-seq PersistentArrayMap PersistentArrayMapIterator PersistentArrayMapSeq PersistentHashMap PersistentHashSet PersistentQueue PersistentQueueIter PersistentQueueSeq PersistentTreeMap PersistentTreeMapSeq PersistentTreeSet PersistentVector pop pop! pop-tail pos-int? pos? pr pr-opts pr-sb-with-opts pr-seq-writer pr-sequential-writer pr-str pr-str* pr-str-with-opts pr-with-opts pr-writer pr-writer-ex-info pr-writer-impl prefer-method prefers prefers* preserving-reduced prim-seq print print-map print-meta? print-prefix-map print-str println println-str prn prn-str prn-str-with-opts PROTOCOL_SENTINEL push-tail pv-aget pv-aset pv-clone-node pv-fresh-node pv-reduce

    Q qualified-ident? qualified-keyword? qualified-symbol? quot quote-string

    R ->Range ->RangedIterator ->RangeIterator ->RecordIter ->RedNode ->Reduced ->RSeq rand rand-int rand-nth random-sample random-uuid range Range ranged-iterator RangedIterator RangeIterator re-find re-matches re-pattern re-seq realized? record? RecordIter RedNode reduce reduce-kv reduceable? Reduced reduced reduced? reductions regexp? rem remove remove-all-methods remove-method remove-pair remove-watch repeat repeatedly replace replicate reset! reset-cache reset-meta! reset-vals! rest reverse reversible? RSeq rseq rsubseq run!

    S ->SeqIter ->Single ->StringBufferWriter ->StringIter ->Subvec ->Symbol scan-array second select-keys seq seq-iter seq-reduce seq? seqable? SeqIter sequence sequential? set set-from-indexed-seq set-print-err-fn! set-print-fn! set-validator! set? short shorts shuffle simple-ident? simple-keyword? simple-symbol? Single some some-fn some? sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? split-at split-with spread START str string-hash-cache string-hash-cache-count string-iter string-print string? StringBufferWriter StringIter strip-ns subs subseq Subvec subvec swap! swap-global-hierarchy! swap-vals! Symbol symbol symbol-identical? symbol? system-time

    T *target* ->TaggedLiteral ->TransformerIterator ->TransientArrayMap ->TransientHashMap ->TransientHashSet ->TransientVector tagged-literal tagged-literal? TaggedLiteral tail-off take take-last take-nth take-while test throw-no-method-error to-array to-array-2d trampoline transduce transformer-iterator TransformerIterator transient TransientArrayMap TransientHashMap TransientHashSet TransientVector tree-map-add tree-map-append tree-map-kv-reduce tree-map-remove tree-map-replace tree-map-seq-push tree-seq true? truth_ tv-editable-root tv-editable-tail tv-ensure-editable tv-pop-tail tv-push-tail type type->str

    U *unchecked-arrays* *unchecked-if* ->UUID unchecked-add unchecked-add-int unchecked-array-for unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-editable-array-for unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int undefined? underive unreduced unsigned-bit-shift-right update update-in uri? uuid UUID uuid?

    V ->ValSeq ->Var ->VectorNode ->Volatile val vals ValSeq Var var? vary-meta vec vector vector-index-out-of-bounds vector? VectorNode Volatile volatile! volatile? vreset!

    W *warn-on-infer* with-meta write-all

    Z zero? zipmap

    cljs.pprint — cljsDocsSource

    VARS

    A ->arg-navigator abort? absolute-reposition absolute-tabulation add-core-ns add-english-scales add-padding add-to-buffer ancestor? arg-navigator

    B ->buffer-blob base-str boolean-conditional brackets buffer-blob buffer-blob? buffer-length

    C *code-table* *current-length* *current-level* ->compiled-directive c-write-char cached-compile capitalize-string capitalize-word-writer char-code check-arg-conditional check-enumerated-arg check-flags choice-conditional cl-format code-dispatch collect-clauses column-writer compile-directive compile-format compile-raw-string compiled-directive conditional-newline consume consume-while convert-ratio

    D *default-page-width* directive-table dollar-float downcase-writer

    E ->end-block-t else-separator? emit-nl emit-nl? end-block end-block-t end-block-t? english-cardinal-tens english-cardinal-units english-ordinal-tens english-ordinal-units english-scale-numbers execute-format execute-sub-format expand-fixed exponential-float extract-flags extract-param extract-params

    F *format-str* fixed-float flag-defs float-parts float-parts-base float? format-ascii format-cardinal-english format-error format-integer format-logical-block format-new-roman format-old-roman format-ordinal-english format-roman format-simple-cardinal format-simple-number format-simple-ordinal fresh-line

    G general-float get-column get-field get-fixed get-format-arg get-line get-max-column get-miser-width get-pretty-writer get-section get-sub-section get-writer group-by*

    I ->indent-t inc-s indent indent-t indent-t? init-cap-writer init-navigator insert-decimal insert-scaled-decimal integral? IPrettyFlush iterate-list-of-sublists iterate-main-list iterate-main-sublists iterate-sublist

    J javascript-base-formats justify-clauses

    L ->logical-block level-exceeded linear-nl? logical-block logical-block-or-justify ltrim

    M make-buffer-blob make-end-block-t make-indent-t make-nl-t make-pretty-writer make-start-block-t map->arg-navigator map->buffer-blob map->compiled-directive map->end-block-t map->indent-t map->logical-block map->nl-t map->start-block-t map-params map-passing-context map-ref-type miser-nl? modify-case multi-defn

    N ->nl-t needs-pretty new-roman-table next-arg next-arg-or-nil nl nl-t nl-t?

    O old-roman-table opt-base-str

    P *print-base* *print-circle* *print-lines* *print-miser-width* *print-pprint-dispatch* *print-pretty* *print-radix* *print-right-margin* *print-shared* *print-suppress-namespaces* p-write-char param-pattern plain-character pp-newline pprint pprint-anon-func pprint-array pprint-binding-form pprint-code-list pprint-code-symbol pprint-cond pprint-condp pprint-defn pprint-hold-first pprint-ideref pprint-if pprint-indent pprint-let pprint-list pprint-map pprint-newline pprint-ns pprint-ns-reference pprint-pqueue pprint-reader-macro pprint-set pprint-simple-code-list pprint-simple-default pprint-simple-list pprint-tab pprint-vector pr prefix-count pretty-character pretty-writer pretty-writer? print print-char print-table println prn process-bracket process-clause process-nesting

    R readable-character reader-macros realize-parameter realize-parameter-list relative-reposition relative-tabulation remainders render-clauses right-bracket round-str rtrim

    S *symbol-map* ->start-block-t separator? set-field set-indent set-max-column set-pprint-dispatch simple-dispatch single-defn special-chars special-params special-radix-markers split-at-newline start-block start-block-t start-block-t?

    T table-ize tokens-fit? translate-param tuple-map two-forms type-dispatcher type-map

    U unzip-map upcase-writer update-nl-state use-method

    W write write-buffered-output write-initial-lines write-line write-out write-token write-token-string write-tokens write-white-space

    cljs.test — cljsDocsSource
    A unit testing framework.
    
    ASSERTIONS
    
    The core of the library is the "is" macro, which lets you make
    assertions of any arbitrary expression:
    
    (is (= 4 (+ 2 2)))
    (is (instance? Integer 256))
    (is (.startsWith "abcde" "ab"))
    
    You can type an "is" expression directly at the REPL, which will
    print a message if it fails.
    
        user> (is (= 5 (+ 2 2)))
    
        FAIL in  (:1)
        expected: (= 5 (+ 2 2))
          actual: (not (= 5 4))
        false
    
    The "expected:" line shows you the original expression, and the
    "actual:" shows you what actually happened.  In this case, it
    shows that (+ 2 2) returned 4, which is not = to 5.  Finally, the
    "false" on the last line is the value returned from the
    expression.  The "is" macro always returns the result of the
    inner expression.
    
    There are two special assertions for testing exceptions.  The
    "(is (thrown? c ...))" form tests if an exception of class c is
    thrown:
    
    (is (thrown? ArithmeticException (/ 1 0))) 
    
    "(is (thrown-with-msg? c re ...))" does the same thing and also
    tests that the message on the exception matches the regular
    expression re:
    
    (is (thrown-with-msg? ArithmeticException #"Divide by zero"
                          (/ 1 0)))
    
    DOCUMENTING TESTS
    
    "is" takes an optional second argument, a string describing the
    assertion.  This message will be included in the error report.
    
    (is (= 5 (+ 2 2)) "Crazy arithmetic")
    
    In addition, you can document groups of assertions with the
    "testing" macro, which takes a string followed by any number of
    assertions.  The string will be included in failure reports.
    Calls to "testing" may be nested, and all of the strings will be
    joined together with spaces in the final report, in a style
    similar to RSpec <http://rspec.info/>
    
    (testing "Arithmetic"
      (testing "with positive integers"
        (is (= 4 (+ 2 2)))
        (is (= 7 (+ 3 4))))
      (testing "with negative integers"
        (is (= -4 (+ -2 -2)))
        (is (= -1 (+ 3 -4)))))
    
    Note that, unlike RSpec, the "testing" macro may only be used
    INSIDE a "deftest" form (see below).
    
    
    DEFINING TESTS
    
    (deftest addition
      (is (= 4 (+ 2 2)))
      (is (= 7 (+ 3 4))))
    
    (deftest subtraction
      (is (= 1 (- 4 3)))
      (is (= 3 (- 7 4))))
    
    This creates functions named "addition" and "subtraction", which
    can be called like any other function.  Therefore, tests can be
    grouped and composed, in a style similar to the test framework in
    Peter Seibel's "Practical Common Lisp"
    <http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html>
    
    (deftest arithmetic
      (addition)
      (subtraction))
    
    The names of the nested tests will be joined in a list, like
    "(arithmetic addition)", in failure reports.  You can use nested
    tests to set up a context shared by several tests.
    
    DEFINING ASYNC TESTS
    
    (deftest addition
      (async done
        (is (= 4 (+ 2 2)))
        (is (= 7 (+ 3 4)))
        (done)))
    
    Async tests are constructed with the async macro. The first argument to
    the macro is the test completion callback. The body of the async macro may
    be any series of expressions. The completion callback must be invoked when
    all assertions have run. There is no support for asynchronous coordination -
    core.async is recommended for this. Note the body of the async test must be
    truly asynchronous to avoid stack overflow.
    
    RUNNING TESTS
    
    Run tests with the function "(run-tests namespaces...)":
    
    (run-tests 'your.namespace 'some.other.namespace)
    
    If you don't specify any namespaces, the current namespace is
    used.  To run all tests in all namespaces, use "(run-all-tests)".
    
    By default, these functions will search for all tests defined in
    a namespace and run them in an undefined order.  However, if you
    are composing tests, as in the "arithmetic" example above, you
    probably do not want the "addition" and "subtraction" tests run
    separately.  In that case, you must define a special function
    named "test-ns-hook" that runs your tests in the correct order:
    
    (defn test-ns-hook []
      (arithmetic))
    
    "run-tests" also optionally takes a testing enviroment. A default
    one is supplied for you by invoking "empty-env".  The test
    environment contains everything needed to run tests including the
    report results map. Fixtures must be present here if you want them
    to run. Note that code that relies on "test-ns" will
    automatically be supplied the appropriate defined fixtures.  For
    example, this is done for you if you use "run-tests".
    
    Note: test-ns-hook prevents execution of fixtures (see below).
    
    
    OMITTING TESTS FROM PRODUCTION CODE
    
    You can set the ClojureScript compiler build option
    ":load-tests" to false when loading or compiling code in
    production.  This will prevent any tests from being created by
    or "deftest".
    
    
    FIXTURES
    
    Fixtures allow you to run code before and after tests, to set up
    the context in which tests should be run.
    
    A fixture is a map of one or two functions that run code before and
    after tests.  It looks like this:
    
    {:before (fn []
               Perform setup, establish bindings, whatever.
               )
     :after (fn []
              Tear-down / clean-up code here.
              )}
    
    Both are optional and can be left out.
    
    Fixtures are attached to namespaces in one of two ways.  "each"
    fixtures are run repeatedly, once for each test function created
    with "deftest".  "each" fixtures are useful for
    establishing a consistent before/after state for each test, like
    clearing out database tables.
    
    "each" fixtures can be attached to the current namespace like this:
    (use-fixtures :each fixture1 fixture2 ...)
    The fixture1, fixture2 are just maps like the example above.
    They can also be passed directly, like this:
    (use-fixtures :each
      {:before (fn [] setup...), :after (fn [] cleanup...)})
    
    The other kind of fixture, a "once" fixture, is only run once,
    around ALL the tests in the namespace.  "once" fixtures are useful
    for tasks that only need to be performed once, like establishing
    database connections, or for time-consuming tasks.
    
    Attach "once" fixtures to the current namespace like this:
    (use-fixtures :once fixture1 fixture2 ...)
    
    Note: Fixtures and test-ns-hook are mutually incompatible.  If you
    are using test-ns-hook, fixture functions will *never* be run.
    
    
    WRAPPING FIXTURES
    
    Instead of a map, a fixture can be specified like this:
    
    (defn my-fixture [f]
       Perform setup, establish bindings, whatever.
      (f)  Then call the function we were passed.
       Tear-down / clean-up code here.
     )
    
    This style is incompatible with async tests. If an async test is
    encountered, testing will be aborted. It can't be mixed with
    fixtures specified as maps.
    
    
    EXTENDING TEST-IS (ADVANCED)
    
    You can extend the behavior of the "is" macro by defining new
    methods for the "assert-expr" multimethod.  These methods are
    called during expansion of the "is" macro, so they should return
    quoted forms to be evaluated.
    
    You can plug in your own test-reporting framework by specifying a
    :reporter key in the test environment. It is normally set to
    :cljs.test/default. Set this to the desired key and supply custom
    implementations of the "report" multimethod.
    
    The 'event' argument is a map.  It will always have a :type key,
    whose value will be a keyword signaling the type of event being
    reported.  Standard events with :type value of :pass, :fail, and
    :error are called when an assertion passes, fails, and throws an
    exception, respectively.  In that case, the event will also have
    the following keys:
    
      :expected   The form that was expected to be true
      :actual     A form representing what actually occurred
      :message    The string message given as an argument to 'is'
    
    The "testing" strings will be a list in the :testing-contexts
    property of the test environment, and the vars being tested will be
    a list in the :testing-vars property of the test environment.
    
    For additional event types, see the examples in the code.
    clojure.walk — cljsDocsSource
    This file defines a generic tree walker for Clojure data
    structures.  It takes any data structure (list, vector, map, set,
    seq), calls a function on every element, and uses the return value
    of the function in place of the original.  This makes it fairly
    easy to write recursive search-and-replace functions, as shown in
    the examples.
    
    Note: "walk" supports all Clojure data structures EXCEPT maps
    created with sorted-map-by.  There is no (obvious) way to retrieve
    the sorting function.
    re-frame.registrarDocsSource
    In many places, re-frame asks you to associate an id (keyword)
    with a handler (function).  This namespace contains the
    central registry of such associations.
    The README below is fetched from the published project artifact. Some relative links may be broken.

    One for all, all for one
    – Alexandre Dumas, The Three Musketeers

    aramis

    This library provides a Promise.all()-like capabilities for re-frame.

    Demo gif 1

    What’s in it for me?

    Let us elaborate on what’s happening on the gif attached above. When button “prepare party!” is clicked, 4 independent events are dispatched asynchronously. We want to fire an event dispatch that will indicate that the whole process is ready once every event finishes its’ work.

    Use Case examples:
    • Fire a get-user-home request once two independent POST requests are finished.
    • It boosts your optimistic app-db updates! You can dispatch a GET in background and just assume it will be done by the time you need it. So the reasons of waiting at the final step can be transparent for users.

    Add dependency

    [aramis.core "0.1.1"]

    Dispatching a group

    (ns my-app.events
      (:require
        ...
        [re-frame.core :as rf]
        [aramis.core :as aramis]
        ...))
    
    (def collaborators
        [[::bar {:event-id :bar-id}]
         [::baz {:event-id :baz-id} extra-arguments]])
    
    (rf/dispatch
        [::aramis/wait-for-all-to
         collaborators
         [::foo]]])
    

    Make sure, that the collaborators events you dispatch have a hash-map containing :event-id as a first parameter.

    Handling collaborators

    Every event you register as a collaborator must ultimately report its’ success.

    (rf/reg-event-fx
      ::bar
      (fn [{:keys [db]} [_ {:keys [event-id]}]]
        {:http-xhrio
         {:method :post
          :uri "/api/do-something"
          ...
          :on-success [:success event-id]}
         ...}))
    
    (rf/reg-event-fx
      :success
      (fn [{:keys [db]} [_ event-id]]
        {:dispatch-n [[::aramis/report event-id]
                      ... others things you do on succes.
                      ]}))
    

    That’s it?

    To have you ready to try it out? Yes. Does that cover all of the features? Hell no!

    Add a collaborator on the fly

    Imagine that due to your actions you need to add more collaborators and hence delay the ultimate goal dispatch. Aramis’s got you covered!

    • If you want to dispatch and hook to a group:
    (rf/dispatch
      [::aramis/one-of group-id
       [::one-small-favor {:event-id :xyz}]])
    
    • If you want to just hook:
    (rf/dispatch
      [::aramis/add-collaborator group-id
       [::one-small-favor {:event-id :xyz}]])
    

    Data structure explained

    Aramis stores its’ data in appdb under :aramis property.

    {:group-1-id
     {:pending #{:event-1-id :event-2-id}
      :done #{:event-3-id}
      :once-done [::foo/say-hello "World"]}
     :group-2-id
     {:pending #{:event-2-id :event-99-id}
      :once-done [::foo/say-hello "Group 2"]}}
      ```
    Keys of that hashmap are groups registered. 
    - `:pending` contains a set of collaborators still doing their job. 
    - `:once-done` - an event that will be dispatched once `:pending` set is empty.
    
    #### One event collaborating to many groups
    
    One event can collaborate to as many groups as you need. Finishing one group works
    independently from progress in other groups.
     
    #### Status of groups and collaborators
    
    
    Aramis equips you with couple of subscriptions you could use to track progress of your groups:
     
    
    

    (rf/subscribe [::group-status :group1-id]) => {:pending #{:event-1-id :event-2-id} :done #{:event-3-id} :once-done [::foo/say-hello “World”]} ```

    (rf/subscribe [::event-info :event-2-id])
    => {:status :pending
        :collaborates-to #{:group-1-id :group-2-id}}
    
    (rf/subscribe [::event-status :event-x-id])
    => :pending
    
    (subscribe [::event-status-in-group :group-1-id :event-x-id])
    => :pending
    

    Known issues and limitations

    • Dispatching one event in two ::one-of wrappers will disptach the event two times.
    • It’s assumed that status of one event as a collaborator is the same in every group it collaborates to.
    • Proper error handling is yet to be done. Possible scenario ideas will be valuable contribution. Thanks!

    License

    Copyright © 2018 Magnet Coop

    Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.