https://github.com/cdimascio/rx-ballparks-services
https://github.com/cdimascio/rx-ballparks-services
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/cdimascio/rx-ballparks-services
- Owner: cdimascio
- License: mit
- Created: 2016-08-21T23:08:22.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-01-01T01:33:49.000Z (over 9 years ago)
- Last Synced: 2025-02-04T10:57:20.782Z (over 1 year ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```javascript
import RxBallparkServices from 'rx-ballpark-services';
const rbs = RxBallparkServices({
weather: {
apiRoot:
}
});
```
###Initialize (try mode)
*Bluemix account 'not required'*
*Weather Company Data for IBM Bluemix 'not required'*
```javascript
import RxBallparkServices from 'rx-ballpark-services';
const rbs = RxBallparkServices({
weather: {
apiRoot: 'dummy',
useMockData: true
}
});
```
## Apis
### Fetch all ballparks with Weather
```javascript
rbs.BallparksWeatherService
.all()
.subscribe(r => /* do something */, /* handle error */);
```
### Fetch a ballpark by id
```javascript
rbs.BallparksService
.byId(req.params.id)
.subscribe(r => /* do something */, /* handle error */);
```