npm i plomo --save
import React, {Component} from "react";
import Plomo from "plomo/src/components/plomo/Plomo";
class App extends Component {
/**
* Must return Promise<string[]>
*/
loadData = () => {
return new Promise(...);
}
render() {
return <Plomo showCount={20} loadData={this.loadData}/>
}
}
or pure js
import Plomo from "plomo/src/components/pure/Plomo";
var plomo = new Plomo({
loadData: function () {
return new Promise(...);
}
});
document.body.appendChild(plomo.container);
MIT