Chaining
by Outrora
Babel + JSX
const BLOCK_EXPLORERS = {
LUNES: 'https://blockexplorer.lunes.io/',
LUNESTESTNET: 'https://blockexplorer-testnet.lunes.io/',
BTC: 'https://chain.so/btc',
BTCTESTNET: 'https://chain.so/testnet/btc',
LTC: 'https://chain.so/ltc',
LTCTESTNET: 'https://chain.so/testnet/ltc'
}
const LinkClass = function() {
this.where = {
blockexplorer: {
testnet: false
}
}
}
LinkClass.prototype.testnet = () => {
this.where.blockexplorer.testnet = true
return this;
}
LinkClass.prototype.blockexplorer = () => {
return this.where.blockexplorer;
}
LinkClass.prototype.LUNES = function() {
this.where.blockexplorer.url = BLOCK_EXPLORERS.LUNESTESTNET;
return this;
}
LinkClass.prototype.to = function() {
console.log('h');
return this;
}
const Link = new LinkClass();
console.log(Link.to().LUNES().testnet());