Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Calypso-like Applications

Building Calypso-like Applications

@ A Day of REST

Nikolay Bachiyski

January 28, 2016
Tweet

More Decks by Nikolay Bachiyski

Other Decks in Programming

Transcript

  1. TODAY ▸ What did we learn when building Calypso ▸

    How can it help you build similar applcations
  2. render: function() { const size = this.props.size; if ( !

    this.props.user ) { return <span className="gravatar is-placeholder" style={ { width: size, height: size } } />; } const alt = this.props.alt || this.props.user.display_name; const avatarURL = this._getResizedImageURL( safeImageURL( this.props.user.avatar_URL ) ); return ( <img alt={ alt } className="gravatar" src={ avatarURL } width={ size } height={ size } /> ); }
  3. export function requestSitePosts( siteId, query = {} ) { return

    ( dispatch ) => { dispatch( { type: POSTS_REQUEST, siteId, query } ); return wpcom.site( siteId ).postsList( query ).then( ( { found, posts } ) => { dispatch( receivePosts( posts ) ); dispatch( { type: POSTS_REQUEST_SUCCESS, siteId, query, found, posts } ); } ).catch( ( error ) => { dispatch( { type: POSTS_REQUEST_FAILURE, siteId, query, error } ); } ); }; }
  4. ▸ A lot of user interaction ▸ Quick transitions ▸

    Multiple front-ends (web, mobile, desktop) ▸ Skill: JavaScript ▸ Skill: new type of architecture
  5. FUN