Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

ex01.state namespace is not included in the day1/ex01 src #1

Closed
minikomi opened this issue May 9, 2016 · 1 comment
Closed

ex01.state namespace is not included in the day1/ex01 src #1

minikomi opened this issue May 9, 2016 · 1 comment

Comments

@minikomi
Copy link

minikomi commented May 9, 2016

Thank you for making all the workshop code open - trying to follow along from Tokyo.

Attempting to run the day1 example page locally, it seems there's a missing state.cljs file. Referenced here, here, here.

lein figwheel gives:

ANALYSIS ERROR: No such namespace: ex01.state, could not locate ex01/state.cljs, 
ex01/state.cljc, or Closure namespace "ex01.state" in file src/ex01/utils.cljs on 
file null, line null, column null
@minikomi minikomi changed the title ex01.state is not included in the day1 src ex01.state is not included in the day1/ex01 src May 9, 2016
@minikomi minikomi changed the title ex01.state is not included in the day1/ex01 src ex01.state namespace is not included in the day1/ex01 src May 9, 2016
@edap
Copy link

edap commented Nov 6, 2016

hello @minikomi you should add this file state.cljs to the src folder this file

(ns ex01.state
  (:require-macros
   [reagent.ratom :refer [reaction]]
   [cljs-log.core :refer [debug info warn severe]])
  (:require
   [thi.ng.strf.core :as f]
   [reagent.core :as r]))

(defonce app
  (r/atom
   {:size        256
    :samples     []
    :num-samples 30
    :avg         0
    :mode        :naive}))

(defn set-mode!
  [e]
  (let [id (-> e .-target .-value keyword)]
    (debug :set-mode id)
    (swap! app assoc :mode id :samples [] :reset true)))

(defn set-size!
  [e]
  (let [size (-> e .-target .-value (f/parse-int 10))]
    (debug :set-size size)
    (swap! app assoc :size size :samples [] :reset true)))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants