Fork me on GitHub

I want to create a js object with functions in sci. Unfortunately deftype which csn do that is not defined in sci. Is there any way around that? My usecase is that I have to pass an existing javascript a js-object that has 3 functions. It is a type definition that internally uses this.


@hoertlehner Any reason to not just use #js {:a (fn [x]) :b (fn [y])} ?


@borkdude the js librariy I use then cannot find the functtions. For sole stupid reason wanta a function that can be called with "new user-class ()"


I have already loaded a pure javascript file and I tried to (create create-type-of "test1" a-fn b-fn). But so far I have failed.


So the library would run this this js code: var t = new user-type (); t.a(123); t.b (456);