Package Exports
- rx-ballpark-services
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rx-ballpark-services) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
#rx-ballpark-services
Simple set of services used to fetch basic information and weather data about Major Baseball Parks.
Weather Data is provided by Weather Company Data for IBM Bluemix
Usage
###Initialize
import RxBallparkServices from 'rx-ballpark-services';
const rbs = RxBallparkServices({
weather: {
apiRoot: <bluemix-weather-api-url>
}
});
###Initialize (try mode)
Bluemix account 'not required'
Weather Company Data for IBM Bluemix 'not required'
import RxBallparkServices from 'rx-ballpark-services';
const rbs = RxBallparkServices({
weather: {
apiRoot: 'dummy',
useMockData: true
}
});
Apis
Fetch all ballparks with Weather
rbs.BallparksWeatherService
.all()
.subscribe(r => /* do something */, /* handle error */);
Fetch a ballpark by id
rbs.BallparksService
.byId(req.params.id)
.subscribe(r => /* do something */, /* handle error */);