Upgrade to 1.0.1

This commit is contained in:
Jim Myers 2018-12-02 10:17:31 -05:00
parent 3b49874d09
commit b9a98e75f3
3 changed files with 15 additions and 13 deletions

View File

@ -1,11 +1,17 @@
# FlipsideJS
FlipsideJS provides a library embeddable widgets that display data from the Flipside Platform API, including FCAS.
FlipsideJS provides a library of embeddable widgets that display data from the Flipside Platform API, including FCAS.
## Example
[View Live FCAS Example](https://jsfiddle.net/flipsidejim/f7zpd0uj/12/)
## Install
The FlipsideJS library is made available over our CDN to ensure a speedy response time.
```html
<script src="https://js.flipsidecrypto.com/flipside-v1.0.0.js"></script>
<script src="https://d3sek7b10w79kp.cloudfront.net/flipside-v1.0.0.js"></script>
```
## Usage
@ -14,18 +20,18 @@ FlipsideJS provides a library embeddable widgets that display data from the Flip
<div id="container"></div>
<script>
var flipside = new Flipside(YOUR_FLIPSIDE_API_KEY);
flipside.create("container", "BTC");
flipside.create("container", "ZEC");
</script>
```
## API
_create(id: string, symbol: string, options: object)_
Creates an FCAS widget in the given element ID.
Creates an FCAS widget in the given DOM element ID.
#### Parameters
- _id_: ID of the element in which to create the widget.
- _id_: ID of the DOM element in which to create the widget.
- _symbol_: Symbol of the asset. e.g "BTC"
- _opts_: Display options for the widget
@ -56,9 +62,3 @@ flipside.create("container", "ETH", {
```
$ yarn run build
```
## Development
```
$ yarn run dev
```

View File

@ -1,6 +1,6 @@
{
"name": "flipside-js",
"version": "1.0.0",
"version": "1.0.1",
"description": "FlipsideJS provides a library embeddable widgets that display data from the Flipside Platform API, including FCAS.",
"main": "index.js",
"scripts": {

View File

@ -7,7 +7,8 @@ class Flipside {
this.api = new API(apiKey);
}
create(id, symbol, opts) {
createFCAS(id, symbol, opts) {
let symbol = symbol.toLowerCase();
const defaults = {
score: true,
plot: true,
@ -17,6 +18,7 @@ class Flipside {
rank: true
};
const mergedOpts = Object.assign({}, defaults, opts);
render(
<FCAS symbol={symbol} api={this.api} opts={mergedOpts} />,
document.getElementById(id)