How to use the bitsharesjs.ChainStore.subscribe function in bitsharesjs

To help you get started, we’ve selected a few bitsharesjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitshares / bitshares-ui / app / stores / AccountRefsStore.js View on Github external
constructor() {
        super();
        this._export("loadDbData", "getAccountRefs");
        this.state = this._getInitialState();
        this.bindListeners({onAddPrivateKey: PrivateKeyActions.addKey});
        this.no_account_refs = Immutable.Set(); // Set of account ids
        ChainStore.subscribe(this.chainStoreUpdate.bind(this));
    }
github bitshares / bitshares-ui / app / stores / WalletDb.js View on Github external
constructor() {
        super();
        this.state = {wallet: null, saving_keys: false};
        // Confirm only works when there is a UI (this is for mocha unit tests)
        this.confirm_transactions = true;
        ChainStore.subscribe(this.checkNextGeneratedKey.bind(this));
        this.generateNextKey_pubcache = [];
        // WalletDb use to be a plan old javascript class (not an Alt store) so
        // for now many methods need to be exported...
        this._export(
            "checkNextGeneratedKey",
            "getWallet",
            "onLock",
            "isLocked",
            "decryptTcomb_PrivateKey",
            "getPrivateKey",
            "process_transaction",
            "transaction_update",
            "transaction_update_keys",
            "getBrainKey",
            "getBrainKeyPrivate",
            "onCreateWallet",
github bitshares / bitshares-ui / app / App.jsx View on Github external
_setListeners() {
        try {
            window.addEventListener("resize", this._getWindowHeight, {
                capture: false,
                passive: true
            });
            NotificationStore.listen(this._onNotificationChange.bind(this));
            ChainStore.subscribe(this._chainStoreSub);
            AccountStore.tryToSetCurrentAccount();
        } catch (e) {
            console.error("e:", e);
        }
    }
github bitshares / bitshares-ui / app / App.jsx View on Github external
_setListeners() {
        try {
            window.addEventListener("resize", this._getWindowHeight, {
                capture: false,
                passive: true
            });
            NotificationStore.listen(this._onNotificationChange.bind(this));
            ChainStore.subscribe(this._chainStoreSub);
            AccountStore.tryToSetCurrentAccount();
        } catch (e) {
            console.error("e:", e);
        }
    }
github bitshares / bitshares-ui / app / components / Utility / BindToChainState.jsx View on Github external
componentWillMount() {
            ChainStore.subscribe(this.update);
            this.update();
        }
github bitshares / bitshares-ui / app / components / Modal / ProposalApproveModal.jsx View on Github external
componentWillMount() {
        this._updateState();

        ChainStore.subscribe(this._updateState);
    }
github bitshares / bitshares-ui / app / components / Dashboard / MarketsTable.jsx View on Github external
componentWillMount() {
        this.update();
        ChainStore.subscribe(this.update);
    }