Skip to content
Permalink
Browse files

Created pluck operator for stream.

  • Loading branch information...
stanimirovic committed Jul 11, 2019
1 parent e6ced30 commit b790b7ef7ce875b8e496a0fb572dc5419a446405
Showing with 5 additions and 29 deletions.
  1. +0 −24 CHANGELOG.md
  2. +1 −1 README.md
  3. +0 −3 doc/intro.md
  4. +1 −1 project.clj
  5. +3 −0 src/re_streamer/stream.cljc

This file was deleted.

@@ -10,7 +10,7 @@ To use Re-Streamer in your Leiningen project, add this dependency in project.clj

## Examples

Check examples directory in this repository.
Check examples directory.

## License

This file was deleted.

@@ -1,4 +1,4 @@
(defproject org.clojars.stanimirovic/re-streamer "0.2.4"
(defproject org.clojars.stanimirovic/re-streamer "0.2.5"
:description "Clojure and ClojureScript Library for Reactive Programming"
:url "https://github.com/stanimirovic/re-streamer"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
@@ -22,6 +22,9 @@
((:subscribe! stream) (comp sub f))))
(select-keys [:subscribe! :unsubscribe! :flush!])))

(defn pluck [stream keys]
(map stream #(select-keys % keys)))

(defn filter [stream f]
(-> (assoc stream :subscribe! (fn [sub]
((:subscribe! stream) #(if (f %) (sub %)))))

0 comments on commit b790b7e

Please sign in to comment.
You can’t perform that action at this time.