nb-sync-session
v1.0.2
Published
Simple synchronous session for multiple browser tab, using storage.
Downloads
3
Readme
nb-sync-session
浏览器多标签 session storage 同步方案
Install
$ nbnpm install nb-sync-session
Usage
import SyncSession from 'nb-sync-session'
const token = new SyncSession('token', () => {
// token updated
// TODO
})
// 设置主动失效时间为30分钟
const user = new SyncSession('user', 1000 * 60 * 30)
// get
token.get()
user.get()
// set
token.set('new-token-value')
user.set('new-user-value')
// remove
token.remove()
user.remove()