How to use the gun.text function in gun

To help you get started, we’ve selected a few gun 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 amark / gun / examples / react / src / Chat.js View on Github external
send = e => {
    e.preventDefault()
    const who = this.state.name || 'user' + Gun.text.random(6)
    this.setState({name: who})
    document.cookie = ('alias=' + who) 
    const when = Gun.time.is()
    const key = `${when}_${Gun.text.random(4)}`
    this.gun.path(key).put({
      who,
      when,
      what: this.state.newMsg,
    })
    this.setState({newMsg: ''})
  }
  render() {
github sjones6 / gun-flint / bin / commands / gun / examples / react / src / Todos.js View on Github external
add = e => {
    e.preventDefault()
    this.gun.path(Gun.text.random()).put(this.state.newTodo)
    this.setState({newTodo: ''})
  }
  del = key => this.gun.path(key).put(null)
github sjones6 / gun-flint / bin / commands / gun / examples / react / src / Chat.js View on Github external
send = e => {
    e.preventDefault()
    const who = this.state.name || 'user' + Gun.text.random(6)
    this.setState({name: who})
    document.cookie = ('alias=' + who) 
    const when = Gun.time.is()
    const key = `${when}_${Gun.text.random(4)}`
    this.gun.path(key).put({
      who,
      when,
      what: this.state.newMsg,
    })
    this.setState({newMsg: ''})
  }
  render() {
github amark / gun / examples / react / src / Todos.js View on Github external
add = e => {
    e.preventDefault()
    this.gun.path(Gun.text.random()).put(this.state.newTodo)
    this.setState({newTodo: ''})
  }
  del = key => this.gun.path(key).put(null)

gun

A realtime, decentralized, offline-first, graph data synchronization engine.

(Zlib OR MIT OR Apache-2.0)
Latest version published 1 year ago

Package Health Score

64 / 100
Full package analysis