graphenejs-lib
graphenejs-lib copied to clipboard
Webpage example?
Hi,
Can you provide a simple example of converting the node.js code into a regular JS for use in a non-node.js website?
The code from the readme for example:
import {Apis} from "graphenejs-ws";
var {ChainStore} = require("graphenejs-lib");
Apis.instance("wss://bitshares.openledger.info/ws", true).init_promise.then((res) => {
console.log("connected to:", res[0].network);
ChainStore.init().then(() => {
ChainStore.subscribe(updateState);
});
});
let dynamicGlobal = null;
function updateState(object) {
dynamicGlobal = ChainStore.getObject("2.1.0");
console.log("ChainStore object update\n", dynamicGlobal ? dynamicGlobal.toJS() : dynamicGlobal);
}
In the steemjs-lib package you have listed some JS browser examples, and also there is an index.html in the examples folder, while the graphene lib you made does not.
I'm not a node user, and am just looking to get this working through regular web development.
Thank you for the assistance. Peace.