already icon indicating copy to clipboard operation
already copied to clipboard

strongly typed props?

Open dzmitry-lahoda opened this issue 2 years ago • 0 comments

may be props1, props2, props3?

https://stackoverflow.com/questions/28250680/how-do-i-access-previous-promise-results-in-a-then-chain?noredirect=1&lq=1

https://stackoverflow.com/questions/28714298/how-to-chain-and-share-prior-results-with-promises?noredirect=1&lq=1

trying to simplify this, but being typed (no any)

const connect = async (): Promise<JunoConnection> =>
    DirectSecp256k1HdWallet.fromMnemonic(ALICE, {
        prefix: PREFIX,
    })
        .then(x =>
            identity({
                connection: SigningCosmWasmClient.connectWithSigner(RPC, x, {
                    gasPrice: GasPrice.fromString("0.02ujunox"),
                    prefix: PREFIX
                }),

                signer: x.getAccounts().then(x => x[0].address)
            })
        )
        // when handling [] TS degenerates to any
        .then((x) => Promise.all([x.connection, x.signer])) 
        .then(([connection, signer]) => { return { connection, signer } })

dzmitry-lahoda avatar Sep 08 '22 20:09 dzmitry-lahoda