localForage/localForage

Make "name" optional in config when driver = localstorage

Open

#641 建立於 2017年1月6日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)JavaScript (24,184 star) (1,260 fork)batch import
bugdocshelp wantedquestion

描述

I am trying to read key "counter" from localstorage, but can't, because it tries to read "/counter" if I set name to "". If I set name to "whatever" it reads "whatever/counter". Can you change line 20 in localForage/src/drivers/localstorage.js from dbInfo.keyPrefix = dbInfo.name + '/'; to something like dbInfo.keyPrefix = (dbInfo.name && dbInfo.name != "") ? dbInfo.name + '/' : '';

貢獻者指南

Make "name" optional in config when driver = localstorage · localForage/localForage#641 | Good First Issue