Skip to content

Instantly share code, notes, and snippets.

View reygreen1's full-sized avatar
🖨️

RayGuo reygreen1

🖨️
View GitHub Profile
@reygreen1
reygreen1 / store_usage.md
Last active October 19, 2022 09:02
store.js官方使用文档的翻译,便于大家阅读。

store.js使用简介

store.js 提供了一套跨浏览器的本地存储解决方案。

// 将 'marcus' 存为 'username'
store.set('username', 'marcus')

// 获取 'username'

TL,DR: 务必总是在构建函数里定义实例属性。

在小胖的PoorPhy物理库里,有很多类似这样的代码:

function WorldA () {
  // ...
}

WorldA.prototype = {