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
| // http://amanvirk.me/singleton-classes-in-es6/ | |
| let instance = null; | |
| class SingletonModuleScopedInstance { | |
| constructor() { | |
| if (!instance) { | |
| instance = this; | |
| } | |
| this._type = 'SingletonModuleScopedInstance'; |
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 fetch -p && for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done |
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
| import axios from 'axios'; | |
| class Service { | |
| constructor() { | |
| let service = axios.create({ | |
| headers: {csrf: 'token'} | |
| }); | |
| service.interceptors.response.use(this.handleSuccess, this.handleError); | |
| this.service = service; | |
| } |