Fork me on GitHub
#clojurescript
<
2021-07-24
>
zendevil.eth04:07:14

Also the solidity compiler automatically creates getters for public variables

zendevil.eth09:07:59

I’m trying to write new web3.eth.Contract(foo,bar) and I have this:

(.. web3 -eth (Contract.                                           
                (:contract-json db) 
                (-> db :creation :creation/contract-address))) 
But this is giving me
ioc_helpers.cljs:50 Uncaught Error: Please use the "new" keyword to instantiate a web3.eth.Contract() object!
How do I fix this?

zendevil.eth09:07:58

btw, doing (prn web3.eth) gives me undefined so (web3.eth.Contract. didn’t work

thheller09:07:52

@ps the interop is wrong. try (new (.. web -eth -Contract) ...)

olaf12:07:38

Hey, what are the best resources out there to learn how to add a REPL functionality in a webpage? The goal is to have a editor+output+display panels as CodePen and similar. I checked https://github.com/swannodette/cljs-bootstrap but I didn't understood if is what I need and also seems a bit outdated - but I don't know -

p-himik12:07:25

Sounds exactly like what @U050G2TQJ is doing.

borkdude21:07:19

@U01UYD2CL10 you could also check out https://4clojure.oxal.org/ which is using SCI + nextjournal/clojure-mode

borkdude21:07:47

or just the nextjournal/clojure-mode page itself: https://nextjournal.github.io/clojure-mode/

borkdude21:07:11

I've also built this REPL-like thing: https://babashka.org/xterm-sci/

borkdude21:07:54

There is also this demo: https://adam-james-v.github.io/posts/radish-basic-example/index.html which is using scittle (which is a ready to go packaging of SCI for direct embedding into a web page, without any CLJS project setup)

borkdude21:07:17

For self-hosted CLJS there's also Klipse which you may find interesting

olaf01:07:13

Thanks to all for saving me hours, is exactly what I was looking for. 😊