This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Maybe(() => data.personsFirstName[0].value) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Maybe(null) | |
| .then( _ => console.log('Hey it has a value!!!') ) | |
| .catch( _ => console.log('You got a null value!!!') ) | |
| // You got a null value!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const Maybe = (data) => { | |
| let value | |
| if (data.constructor === Function) { | |
| try { value = data() } | |
| catch (error) { return Promise.reject(error) } | |
| } else { | |
| value = data | |
| } | |
| return value !== undefined && value !== null | |
| ? Promise.resolve(value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Maybe(1) | |
| .then( | |
| value => console.log('Hey it has a value!!!', value), | |
| error => console.log('You got a null value!!!', error) | |
| ) | |
| // Hey it has a value!!! 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default ( {init, reactor} ) => { | |
| init(()=>[ | |
| fetch | |
| ]) | |
| const fetch = () => | |
| $.get('//api.github.com/users/javiani') | |
| .then( response => reactor( response ) ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <section data-component="avatar"> | |
| <template> | |
| <ul soda-if="id" class="collection"> | |
| <li class="collection-item avatar"> | |
| <img soda-src="{{avatar_url}}" alt="{{name}}" class="circle" /> | |
| <h2 class="title">{{name}}</h2> | |
| <p>Followers :{{followers}}</p> | |
| </li> | |
| </ul> | |
| </template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## UI Theme | |
| - Atom Material | |
| - Primary color : 0, 128, 192 | |
| ##Syntax Theme | |
| - Nord Atom | |
| ## Font | |
| - Inconsolata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Npm Install | |
| npm install --save babel-core babel-loader babel-preset-es2015 css-loader extract-text-webpack-plugin glob stylus stylus-loader webpack | |
| # Directories tree | |
| /source | |
| - apps | |
| - home | |
| - index.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git archive --format=zip HEAD `git diff HEAD^ HEAD --name-only` > a.zip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "rules": { | |
| "indent": [2,"tab"], | |
| "quotes": [2,"single"], | |
| "linebreak-style": [2,"unix"], | |
| "semi": [2,"never"], | |
| "no-unused-vars": ["error", { "vars": "all", "args": "none" }] | |
| }, | |
| "env": { | |
| "es6": true, |