MCPcopy Create free account
hub / github.com/Tencent/kbone / setItem

Method setItem

packages/miniprogram-render/src/bom/storage.js:131–140  ·  view source on GitHub ↗
(key, data)

Source from the content-addressed store, hash-verified

129 }
130
131 setItem(key, data) {
132 if (!key || typeof key !== 'string') return
133 data = '' + data
134
135 const oldValue = wx.getStorageSync(key) || null
136
137 wx.setStorageSync(key, data)
138 this.$_updateInfo()
139 this.$_triggerStorage(key, data, oldValue)
140 }
141
142 removeItem(key) {
143 if (!key || typeof key !== 'string') return

Callers 1

storage.test.jsFile · 0.45

Calls 2

$_updateInfoMethod · 0.95
$_triggerStorageMethod · 0.80

Tested by

no test coverage detected