Creating AWS Observables

We're now ready to start to implement our solution. If you recall Chapter 2A Look at Reactive Extensions, RxJava/RxJS/RxClojure ships with several useful Observables. However, when the built-in Observables aren't enough, it gives us the tools to build our own.

Since it is highly unlikely that RxJS already provides Observables for Amazon's AWS API, we will start by implementing our own primitive Observables.

To keep things neat, we will do this in a new file, under aws-dash/src/cljs/aws_dash/observables.cljs:

(ns aws-dash.observables (:require-macros [cljs.core.async.macros :refer [go]]) (:require [cljs-http.client :as http] [cljs.core.async :refer [<!]] [cognitect.transit :as t])) (def r (t/reader :json)) (def aws-endpoint ...

Get Hands-On Reactive Programming with Clojure - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.