A Pen by Mike Fielden

Thumbnail
This awesome code was written by ColdToast, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright ColdToast ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Mike Fielden</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
  
  
</head>

<body>

  
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/ColdToast/a-pen-by-mike-fielden-rpzYPw */
const id = 'id'
  , entityType = 'crew'
  , status = 'interesting state'
  , chunk = {
    old_val: {}
  }
  , getFullyPopulatedEntity = (id, tableName) => {
    console.log({id, tableName})
  }
  , getTableNameFromEntityType = entityTypeFromModel => {
     console.log(entityTypeFromModel)
    
     return 'chester the cat'
  } 
  , cb = (err, obj) => {
      obj.getPopulated()
    }
  ;

cb(null, {
  id,
  entityType,
  old_val: chunk.old_val,
  new_val: chunk.old_val,
  status,
  actions: [],
  getPopulated: function () {return getFullyPopulatedEntity(this.id, getTableNameFromEntityType(this.entityType))} 
});

Comments