Skip to content

Commit

Permalink
Created pluck operator for stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
markostanimirovic committed Jul 11, 2019
1 parent e6ced30 commit b790b7e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
24 changes: 0 additions & 24 deletions CHANGELOG.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions doc/intro.md

This file was deleted.

2 changes: 1 addition & 1 deletion project.clj
@@ -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"
Expand Down
3 changes: 3 additions & 0 deletions src/re_streamer/stream.cljc
Expand Up @@ -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 %)))))
Expand Down

0 comments on commit b790b7e

Please sign in to comment.