dbrattli / aioreactive

Async/await reactive tools for Python 3.11+
MIT License
350 stars 24 forks source link

Reexport all operators in aioreactive.operators #15

Closed vodik closed 5 years ago

vodik commented 6 years ago

Just noticed that some of the operations aren't reexported from aioreactive.operators that are exposed in other places (like Operations).

I'd like to see this fixed as I've been playing with Hy, which had threading macros making this the preferable way of building a stream. For example, the autocomplete example snippet becomes:

(import [aioreactive [operators :as op]]
        [aioreactive.core [AsyncStream])

(setv stream (AsyncStream)
      xs (->> stream
              (op.map (fn [x] (.rstrip (get x "term"))))
              (op.filter (fn [term] (> (len term) 2)))
              (op.debounce 0.5)
              (op.distinct-until-changed)
              (op.flat-map search-wikipedia))
coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.08%) to 81.477% when pulling e48aa805afe260431b6d62ae1965c02d20f5ff39 on vodik:master into 5e8323a86e0568b53eadeb0f973d85dc1fbba0ad on dbrattli:master.

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.08%) to 81.477% when pulling fcb71f2c9135bf9605ce7951cedf9d3f8685c275 on vodik:master into 5e8323a86e0568b53eadeb0f973d85dc1fbba0ad on dbrattli:master.