O'Reilly logo

Cross-platform Desktop Application Development: Electron, Node, NW.js, and React by Dmitry Sheiko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The FileList module

The module handling the file list works pretty similar to the one we have just examined previously:

./js/View/FileList.js

const filesize = require( "filesize" );  class FileListView {      constructor( boundingEl, dirService ){     this.dir = dirService;     this.el = boundingEl;     // Subscribe on DirService updates     dirService.on( "update", () => this.update(     dirService.getFileList() ) );   }     static formatTime( timeString ){     const date = new Date( Date.parse( timeString ) );     return date.toDateString();   }    update( collection ) {     this.el.innerHTML = `<li class="file-list__li file-list__head">         <span class="file-list__li__name">Name</span>         <span class="file-list__li__size">Size</span>  <span class="file-list__li__time">Modified</span> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required