You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this file is incomplete as it seems to lack _id and _rev fields.
For example, if I call get to fetch a document: (.get pouchdb id get-options)
I get a result object with _id and _rev properties. If I try to read these values directly: (.-_id result) (.-_rev result)
I get the correct result in dev build, but undefined in production build with advanced compilation.
However, I'm not sure if we should either update the externs file, or simply convert the result object into Clojure map in application code every time we use get, as it seems that reading any field value from the result object results undefined in advanced compilation. This problem can be avoided altogether by doing the conversion first. On the other hand, I can read id and rev directly in advanced compilation without problem, and _id and _rev are part of pouchdb's default fields, so they should probably be included in the externs file
The text was updated successfully, but these errors were encountered:
Here is the current externs file of pouchdb:
https://github.com/cljsjs/packages/blob/master/pouchdb/resources/cljsjs/pouchdb/common/pouchdb.ext.js
I believe this file is incomplete as it seems to lack
_id
and_rev
fields.For example, if I call
get
to fetch a document:(.get pouchdb id get-options)
I get a result object with
_id
and_rev
properties. If I try to read these values directly:(.-_id result)
(.-_rev result)
I get the correct result in dev build, but
undefined
in production build with advanced compilation.However, I'm not sure if we should either update the externs file, or simply convert the result object into Clojure map in application code every time we use
get
, as it seems that reading any field value from the result object resultsundefined
in advanced compilation. This problem can be avoided altogether by doing the conversion first. On the other hand, I can readid
andrev
directly in advanced compilation without problem, and_id
and_rev
are part of pouchdb's default fields, so they should probably be included in the externs fileThe text was updated successfully, but these errors were encountered: