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
var alpha = nutella.persist.getJsonObjectStore('alpha');
console.log(alpha.filePath());
var beta = nutella.persist.getJsonObjectStore('beta');
console.log(alpha.filePath());
console.log(beta.filePath());
var gamma = nutella.persist.getJsonObjectStore('gamma');
console.log(alpha.filePath());
console.log(beta.filePath());
console.log(gamma.filePath());
console output:
data/TEST-TEST-0/alpha.json
data/TEST-TEST-0/beta.json
data/TEST-TEST-0/beta.json
data/TEST-TEST-0/gamma.json
data/TEST-TEST-0/gamma.json
data/TEST-TEST-0/gamma.json
• same problem with load. it will always load from the most recent pathName.
• same problem in getJsonObjectCollection
my amateur analysis:
somehow alpha and beta are losing their pathNames.
i’m a js newbie w.r.t. OOP, but it seems like the filePath
is shared among all instances of persisted objects.
if i make this change in json_file_persisted_object.js:
Rporter: @tmoher
here’s the behavior:
source code:
• same problem with load. it will always load from the most recent pathName.
• same problem in getJsonObjectCollection
my amateur analysis:
somehow alpha and beta are losing their pathNames.
i’m a js newbie w.r.t. OOP, but it seems like the filePath
is shared among all instances of persisted objects.
if i make this change in json_file_persisted_object.js:
and add the path explicitly in the save call, e.g.:
alpha.save(‘data/…/alpha.json’)
then everything works.
so, i have a workaround for now.
if you can’t fine a quick answer, could you replace
the save function in the nutella lib with:
so that my code will be compatible with any fixes?
The text was updated successfully, but these errors were encountered: