CrossClj

0.10.1 docs

SourceDocs



RECENT
    VARS
    accum
    behavior
    behavior-call
    behavior?
    box
    Boxed
    buffer
    close-all!
    completed
    connect-port
    constantly
    count
    cycle
    deliver
    delta
    depend-on
    dependencies
    deref-events
    Disposable
    empty-queue
    events
    events?
    filter
    flatten
    flatten-ch
    join
    join-ch
    listen-all
    map
    mapcat
    mapcat-ch
    merge
    mult*
    no-op
    no-value
    no-value?
    Observable
    once
    peek!!
    reduce
    reduce-ch
    remove
    run-sampler
    sample
    Signal
    signal?
    subscribe
    throttle
    throttle-ch
    time
    time-ms
    uniq
    uniq-ch
    wait
    zip
    zip-ch

    « Index of all namespaces of this project

    Functions and types for functional reactive programming.
    
    (accum init stream)
    Change an initial value based on an event stream of functions.
    
    macro
    (behavior & form)
    Takes a body of expressions and yields a behavior object that will evaluate
    the body each time it is dereferenced.
    (behavior-call func)
    Takes a zero-argument function and yields a Behavior object that will
    evaluate the function each time it is dereferenced. See: behavior.
    (behavior? x)
    Return true if the object is a behavior.
    
    (box x)
    Box a value to ensure it can be sent through a channel.
    
    protocol
    (unbox x)
    Unbox a boxed value.
    
    (buffer stream)(buffer n stream)
    Buffer all the events in the stream. A maximum buffer size may be specified,
    in which case the buffer will contain only the last n items. It's recommended
    that a buffer size is specified, otherwise the buffer will grow without limit.
    Private
    (close-all! chs)
    (completed x)
    Wraps x to guarantee that it will be the last value in a behavior or event
    stream. The value of x will be cached, and any values after x will be
    ignored.
    Private
    (connect-port stream f & args)
    (constantly value stream)
    Constantly map the same value over an event stream.
    
    (count stream)
    Return an accumulating count of the items in a stream.
    
    (cycle values stream)
    Incoming events cycle a sequence of values. Useful for switching between
    states.
    (deliver stream & msgs)
    Deliver one or more messages to an event stream.
    
    (delta)
    Return a behavior that tracks the time in seconds from when it was created.
    
    Private
    (depend-on parent children)
    Protect a collection of child objects from being GCed before the parent.
    
    Private
    (deref-events mult head ms timeout-val)
    protocol
    (dispose x)
    Clean up any resources an object has before it goes out of scope. In
    Clojure this is called automatically when the object is finalized. In
    ClojureScript this must be called manually.
    (on-dispose x f)
    Add a function to be called when the object is disposed.
    
    (events)(events init)
    Create a referential stream of events. An initial value may optionally be
    supplied, otherwise the stream will be unrealized until the first value is
    pushed to it. Event streams will deref to the latest value pushed to the
    stream.
    (events? x)
    Return true if the object is a stream of events.
    
    (filter pred stream)
    Filter a stream by a predicate.
    
    (flatten stream)
    Flatten a stream of streams into a stream that contains all the values of
    its components.
    Private
    (flatten-ch in valve out)
    (join & streams)
    Join several streams together. Events are delivered from the first stream
    until it is completed, then the next stream, until all streams are complete.
    Private
    (join-ch chs out)
    Private
    (listen-all streams)
    (map f & streams)
    Map a function over a stream.
    
    (mapcat f stream)(mapcat f stream & streams)
    Mapcat a function over a stream.
    
    Private
    (mapcat-ch f in out)
    (merge & streams)
    Combine multiple streams into one. All events from the input streams are
    pushed to the returned stream.
    Private
    (mult* ch)
    A version of clojure.core.async/mult that fixes ASYNC-64.
    This can be removed once a fix is released for core.async.
    Private
    (no-op)
    Private
    (no-value? x)
    protocol
    (listen ob ch)
    Add a listener channel to the observable. The channel will be closed
    when the port of the observable is closed. Returns the channel.
    
    Any events sent to the channel will be boxed to protect the channel from
    nils. To listen for unboxed events, use subscribe.
    (port ob)
    Return a write-only core.async channel. Any elements send to the port will
    be distributed to the listener channels in parallel. Each listener must
    accept before the next item is distributed.
    (once value)
    Create a completed event stream for a single value.
    
    Private
    (peek!! mult time-ms)
    (reduce f stream)(reduce f init stream)
    Create a new stream by applying a function to the previous return value and
    the current value of the source stream.
    Private
    (reduce-ch f init in out)
    (remove pred stream)
    Remove all items in a stream the predicate matches.
    
    Private
    (run-sampler ref interval stop out)
    (sample interval-ms reference)
    Turn a reference into an event stream by deref-ing it at fixed intervals.
    The interval time is specified in milliseconds.
    protocol
    (complete? signal)
    True if the signal's value will no longer change.
    
    (signal? x)
    True if the object is a behavior or event stream.
    
    (subscribe stream channel)
    Deliver events on an event stream to a core.async channel. Returns the
    channel.
    
    The events from the stream cannot include nil. The channel will be closed when
    the event stream is complete.
    (throttle timeout-ms stream)
    Remove any events in a stream that occur too soon after the prior event.
    The timeout is specified in milliseconds.
    Private
    (throttle-ch timeout-ms in out)
    A behavior that tracks the current time in seconds.
    
    Private
    (time-ms)
    (uniq stream)
    Remove any successive duplicates from the stream.
    
    Private
    (uniq-ch in out)
    (wait time-ms)
    Returns a channel that will complete unrealized after specified number of
    milliseconds.
    (zip & streams)
    Combine multiple streams into one. On an event from any input stream, a
    vector will be pushed to the returned stream containing the latest events
    of all input streams.
    Private
    (zip-ch ins out)