-1

I'm using [cljsjs/localforage "1.2.10-0"]

When I do:

(.setItem (.localforage js/window) "mynumber" (clj->js {:number (.-value number)}))

I get this error in WebIDE console:

 TypeError: *TypeError: window.localforage is not a function*

If I test it in firefox browser, it says the same, whilst if I introduce in the console window.localforage.setItem() it works :|

BONUS: each time I compile with lein cljsbuild auto I get this:

*Upstream deps.cljs found on classpath. {:foreign-libs [{
  :file "cljsjs/localforage/development/localforage.inc.js", 
  :provides ["cljsjs.localforage"], 
  :file-min "cljsjs/localforage/production/localforage.min.inc.js"
}], 
:externs ["cljsjs/localForage/common/localforage.ext.js"]}
This is an EXPERIMENTAL FEATURE and is not guarenteed to remain 
stable in future versions.* 
Loïc Faure-Lacroix
  • 13,220
  • 6
  • 67
  • 99
leandro713
  • 1,268
  • 1
  • 10
  • 17
  • This question was caused by **a simple typographical error**. While similar questions may be on-topic here, this one was resolved in a manner unlikely to *help* future readers. This can often be avoided by identifying and closely inspecting the [shortest program necessary to reproduce the problem](http://stackoverflow.com/help/mcve) before posting. – mate64 Oct 24 '15 at 09:00
  • @mate64 i had a conceptual problem, it wasn't typographical. besides that, the question about foreign-libs remains in the dark without a clarification – leandro713 Oct 24 '15 at 15:16

1 Answers1

1

well, seems the correct calling manner is (.-localforage js/window) [note the dash]

(.setItem (.-localforage js/window) "mynumber" (clj->js {:number (.-value number)}))

so far so good :D

Loïc Faure-Lacroix
  • 13,220
  • 6
  • 67
  • 99
leandro713
  • 1,268
  • 1
  • 10
  • 17