An Angular service to get real time data from Crypto Compare API. I got this idea after watching this great video.
import { CryptoCompareModule } from 'ngx-crypto-compare';
...
import { CryptoCompareService, CcMarketSubscription, CcResponse } from 'crypto-compare';
...
marketData$: Observable<CcResponse>;
constructor(private cc: CryptoCompareService) {}
...
this.marketData$ = this.cc.connect(new CcMarketSubscription({
subscriptionType: 'Current', exchangeName: 'Coinbase',
fromSymbol: 'BTC', toSymbol: 'USD'
}));
...
In marketData$
you get Observable
with the type CcResponse
.
Any feedback and stars appreciated 😄