CrossClj

0.2.3 docs

SourceDocs



RECENT
    VARS
    json-decode<
    json-decode>
    json-encode<
    json-encode>

    « Index of all namespaces of this project

    Middleware to perform JSON transformations on core.async messages.
    
    JSON doesn't support keywords or symbols, so these get translated 
    into strings when JSONified.
    
    When decoding JSON, we have no way of knowing what strings are supposed
    to be keywords or symbols, so all input strings stay strings.
    
    As a special case, the parser will translate strings that are map keys
    into keywords for us.
    (json-decode< source-channel)
    Reads strings from the given source channel, JSON decodes them,
    and outputs them to the returned channel.
    (json-decode> target-channel)
    Returns a new channel that accepts strings, JSON decodes them,
    and outputs them to the given target channel.
    (json-encode< source-channel)
    Accepts arbitrary Clojure data on the given channel,
    JSON encodes it, and outputs the resulting strings to the returned channel.
    (json-encode> target-channel)
    Returns a new channel that accepts arbitrary Clojure data, JSON encodes it, 
    and outputs it to the given target channel.