Giter Site home page Giter Site logo

pvinis / uiexplorer-cljs Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 256 KB

React Native UIExplorer in Clojurescript

Home Page: https://www.youtube.com/playlist?list=PLmalQP9SU3s4TTRfyox68RBYkEj14X3cb

License: Eclipse Public License 1.0

Python 4.44% Java 3.36% JavaScript 22.90% Objective-C 11.87% Clojure 57.42%

uiexplorer-cljs's Introduction

uiexplorer-cljs

misha [10:22 PM]
@pvinis the way you wrote it should work. except maybe not console, but js/console. here's what I have (for rum though):

  ([title]
   (.alert (.-Alert ReactNative) title))
  ([title msg]
   (.alert (.-Alert ReactNative) title msg))
  ([title msg buttons]
   (.alert (.-Alert ReactNative) title msg (clj->js buttons))))

(defn alert-button
  ([txt]
   #js {:text txt})
  ([txt on-click]
   #js {:text txt :onPress on-click}))

[10:25]
actually, try replacing (clj->js [{...}]) with [#js {..}], because:

#js [#js {:text "OKd", :onPress #object[Function "function (){return (3);}"]}]

cljs.user=> [#js {:text "OKd" :onPress (fn [] 3)}]
    [#js {:text "OKd", :onPress #object[onPress "function (){return (3);}"]}]





vikeri [9:22 AM]  
@pvinis: I have this:
(`camelify-map-keys` is from `reagent.impl.component`)
```(def alert (fn [{:keys [title message buttons]}]
             (.alert (.-Alert react-native)
                     (str title)
                     message (clj->js (mapv camelify-map-keys buttons)))))

The input then looks like this:

 :message "Message"
 :buttons [{:text  "Cancel"
            :style "cancel"}
           {:text "OK"
            :fn/on-press
                  #(dispatch [:alert/ok])}]}


A Clojure library designed to ... well, that part is up to you.


react-native commit
770091f3c13f7c1bd77c50f979d89a774001fbf0



To get started with your new app, first cd into its directory:
cd uiexplorer-cljs

Run iOS app:
react-native run-ios > /dev/null

To use figwheel type:
re-natal use-figwheel
lein figwheel ios

Reload the app in simulator (⌘ + R)

At the REPL prompt type this:
(in-ns 'uiexplorer-cljs.ios.core)

Changes you make via the REPL or by changing your .cljs files should appear live.

Try this command as an example:
(dispatch [:set-greeting "Hello Native World!"])

✔ Done

purple:Source pvinis$ pwd
/Users/pvinis/Source
purple:Source pvinis$ cd
.DS_Store        pvinis/          uiexplorer-cljs/
purple:Source pvinis$ cd uiexplorer-cljs/
purple:uiexplorer-cljs pvinis$ cd
purple:~ pvinis$ cd Source/pvinis/uiexplorer-cljs/
purple:uiexplorer-cljs pvinis$
## Usage

FIXME

## License

Copyright © 2016 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at
your option) any later version.

uiexplorer-cljs's People

Contributors

pvinis avatar

Stargazers

amobiz avatar Michaela Spevacek avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.