How to use userbase-js - 8 common examples

To help you get started, we’ve selected a few userbase-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github encrypted-dev / userbase / src / proof-of-concept / client / components / Dashboard / logic.js View on Github external
const deleteTodo = async (username, todo, handleRemoveUserAuthentication) => {
  try {
    await userbase.delete(getDbName(username), todo.itemId)
  } catch (e) {
    _errorHandler(e, 'delete todos', handleRemoveUserAuthentication)
  }
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / Dashboard / logic.js View on Github external
const insertTodo = async (username, todo, handleRemoveUserAuthentication) => {
  try {
    await userbase.insert(getDbName(username), { todo })
  } catch (e) {
    _errorHandler(e, 'insert todo', handleRemoveUserAuthentication)
  }
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / Dashboard / logic.js View on Github external
const openDatabase = async (username, onDbChangeHandler) => {
  await userbase.openDatabase(getDbName(username), onDbChangeHandler)
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / User / logic.js View on Github external
const signIn = async (username, password) => {
  try {
    const result = await userbase.signIn(username, password)
    return result
  } catch (e) {
    return _errorHandler(e, 'sign in')
  }
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / User / logic.js View on Github external
const signInWithSession = async () => {
  try {
    const session = await userbase.signInWithSession()
    return session
  } catch (e) {
    return _errorHandler(e, 'sign in with session')
  }
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / User / logic.js View on Github external
const signOut = async () => {
  try {
    await userbase.signOut()
  } catch (e) {
    return _errorHandler(e, 'sign out')
  }
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / User / logic.js View on Github external
const signUp = async (username, password) => {
  try {
    const user = await userbase.signUp(username, password)
    return user
  } catch (e) {
    return _errorHandler(e, 'sign up')
  }
}
github encrypted-dev / userbase / src / proof-of-concept / client / components / Dashboard / logic.js View on Github external
const toggleTodo = async (username, todo, handleRemoveUserAuthentication) => {
  try {
    const markingComplete = !todo.item.completed
    await userbase.update(getDbName(username), { todo: todo.item.todo, completed: markingComplete }, todo.itemId)
  } catch (e) {
    _errorHandler(e, 'toggle todos', handleRemoveUserAuthentication)
  }
}