react-native/local-cli/templates/HelloNavigation/lib/Backend.js
async function sendMessage({name, message}) {
  return _makeSimulatedNetworkRequest((resolve, reject) => {
    const chatForName = backendStateForLoggedInPerson.chats.find(
      chat => chat.name === name
    );
    if (chatForName) {
      chatForName.messages.push({
        name: 'Me',
        text: message,
      });
      resolve();
    } else {
      reject(new Error('Uknown person: ' + name));
    }
  });
}
async function sendMessage({name, message}) {
  return _makeSimulatedNetworkRequest((resolve, reject) => {
    const chatForName = backendStateForLoggedInPerson.chats.find(
      chat => chat.name === name
    );
    if (chatForName) {
      chatForName.messages.push({
        name: 'Me',
        text: message,
      });
      resolve();
    } else {
      reject(new Error('Uknown person: ' + name));
    }
  });
}
async function sendMessage ( { name , message } ) { return _makeSimulatedNetworkRequest ( ( resolve , reject ) => { const chatForName = backendStateForLoggedInPerson . chats . find ( chat => chat . name === name ) ; if ( chatForName ) { chatForName . messages . push ( { name : 'Me' , text : message , } ) ; resolve ( ) ; } else { reject ( new Error ( 'Uknown person: ' + name ) ) ; } } ) ; }
Send given message to given person.
Send given message to given person .