これは、clj-httpライブラリを使用してリモート呼び出しを行うために使用しています。コンソールに試薬でhttp-requestの結果を持つアトムの使用方法
(defn make-remote-call [endpoint]
(go (let [response (<! (http/get endpoint
{:with-credentials? false}))])))
(reset! app-state response)
;(js/console.log (print response)))))
上記のプリントが、これは、コンソールで#object[cljs.core.async.impl.channels.ManyToManyChannel]
を吐き出す
(defn call []
(let [x (r/atom (make-remote-call site))]
(js/console.log x)
正常に動作します。
make-remote-call
機能で応答を返すにはどうすればよいですか。
私はレスポンスを使って原子の値を設定しました。原子内の値を参照しようとすると、エラーが発生します"Uncaught Error: [object Object] is not ISeqable"
とNo protocol method IDeref.-deref defined for type null:
どうしたらいいですか?
私は任意の追加情報