You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
305 B
15 lines
305 B
// @flow
|
|
|
|
import db from 'helpers/db'
|
|
import uuid from 'uuid/v4'
|
|
|
|
// a user is an anonymous way to identify a same instance of the app
|
|
|
|
export default async () => {
|
|
let user = await db.getKey('app', 'user')
|
|
if (!user) {
|
|
user = { id: uuid() }
|
|
db.setKey('app', 'user', user)
|
|
}
|
|
return user
|
|
}
|
|
|