function saveUserRecord(senderID, recipientID, values) {
  console.assert(senderID)
  console.assert(recipientID)
  console.assert(values)
  // console.log('senderID', senderID)
  // console.log('recipientID', recipientID)
  // console.log('values', values)

  // Wrap it into Promise
  return new Promise((resolve, reject) => {
    var params = {
      TableName: DYNAMNO_TABLE.USERVARS,
      Item: {
        userId: senderID,
        appId: recipientID,
        vars: values
      }
    }
    ddb.put(params, (err, data) => {
      if (err) {
        return reject(err)
      } else {
        return resolve(data)
      }
    })
  })
}
/**
 * Call AWS DynamoDB to save user state.
 * @param {string} senderID 
 * @param {string} recipientID 
 * @param {object} values 
 */
Call AWS DynamoDB to save user state.
Call AWS DynamoDB to save user state .
function saveUserRecord(senderID, recipientID, values) {
  console.assert(senderID)
  console.assert(recipientID)
  console.assert(values)
  return new Promise((resolve, reject) => {
    var params = {
      TableName: DYNAMNO_TABLE.USERVARS,
      Item: {
        userId: senderID,
        appId: recipientID,
        vars: values
      }
    }
    ddb.put(params, (err, data) => {
      if (err) {
        return reject(err)
      } else {
        return resolve(data)
      }
    })
  })
}
function saveUserRecord ( senderID , recipientID , values ) { console . assert ( senderID ) console . assert ( recipientID ) console . assert ( values ) return new Promise ( ( resolve , reject ) => { var params = { TableName : DYNAMNO_TABLE . USERVARS , Item : { userId : senderID , appId : recipientID , vars : values } } ddb . put ( params , ( err , data ) => { if ( err ) { return reject ( err ) } else { return resolve ( data ) } } ) } ) }
Call AWS DynamoDB to save user state.
Call AWS DynamoDB to save user state .
// console.log('senderID', senderID) // console.log('recipientID', recipientID) // console.log('values', values) // Wrap it into Promise