Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Andrew Redden
    @androolloyd
    the ones i use are easy enough to define
    async reducers explodes down into the different known state definitions
    Iulian Rotaru
    @mortimr
    Oh, it looks like when you build your store and it goes into the initialization proecess, it finds a key asyncReducers in your state but no reducer for this same key
    Andrew Redden
    @androolloyd
    exactly
    ah oops sorry mis read
    ah sorry maybe i have my wires crossed here
    Iulian Rotaru
    @mortimr
    From what I understand, the store is only aware of "txs", "contracts", "blocks", "accounts", "events", "vtxconfig", "vtxevents", "vtxpoll", "vtxcache", "auth", "fuse", "localSettings", "app", "walletApp" but not of "asyncReducers" in your reducers
    Try adding a random key yo your state and see if it gives you the same error for this new key
    Andrew Redden
    @androolloyd
    you were right, thanks for the random support
    only noticed it when i tried to type safe my state
    Iulian Rotaru
    @mortimr
    :+1:
    One nice tool for this is the & operator on types in Typescript
    type AppState = State & CustomState
    Andrew Redden
    @androolloyd
    oh shit
    for real?
    Iulian Rotaru
    @mortimr
    That's what I do, I define my custom state and reducers in my app, then "merge" the types before giving it to the store creation, and I export this in all my app
    Andrew Redden
    @androolloyd
    ah shit that is nice
    i like that rather than the mono state im using
    Iulian Rotaru
    @mortimr
    It's a very powerful operator, you can do very cool stuff in React with it
    Andrew Redden
    @androolloyd
    Yeah funny enough Ive been doing it with Props
    just didnt mentally connect it for state
    but it makes total sense
    not sure why that association never hit
    use it when combining in Stylesheets + theme through material ui
    Andrew Redden
    @androolloyd
    How can I force reset the cache if I have set permenant:true on my contracts
    all the listeners and stuff too
    if a user were to log out of hte app
    but then login with a new user
    Iulian Rotaru
    @mortimr

    This is how I use it:

    • I set permanent to true for contracts that should be loaded for all users
    • I load contracts in components that require them, and remove them when the component gets unmounted. So if you have user specific contracts, it’s better if you load/unload them dynamically

    (also I’ll investigate the listener issues as I saw that a lot of them are getting created.)

    Andrew Redden
    @androolloyd
    @mortimr good to know thx
    Andrew Redden
    @androolloyd
    Hey @mortimr any update on the listener issue?
    Iulian Rotaru
    @mortimr
    Hi Andrew, I have a lot of work on my project but I will try to free some time to get back on ethvtx (upgrade dependencies, check this listener issue and add erc20 support)
    Andrew Redden
    @androolloyd
    Thanks for the update. With token support perhaps being able to pass a list of addresses to the vortex to manage balances of vs setting them individually
    Iulian Rotaru
    @mortimr
    I can add do that too :)
    add that*
    Iulian Rotaru
    @mortimr

    Hey, gonna probably finish what I had to do this week and start working on ethvtx.

    I’m going to look into the listener issue, add erc20 support and add eip712 signatures support.

    For the erc20 support, I’m planning on doing helpers for the whole payment process, with live status and dynamic dispatchers that should be called on every step in order to do both transfer and allowance within the same process.

    For this I think I will add something like a Payment object with status and a “proceed()” method that will make the user go further in the allowance / transfer steps.

    Does this sound good to you @androolloyd ? I think you have more experience at working with erc20 than me so what are the main pain points rn ?

    Andrew Redden
    @androolloyd
    Balances is a huge pain point. We don’t use allowances but I can imagine that being desirable as you described .
    Iulian Rotaru
    @mortimr

    Currently working on the listener issue. Identified the problem from VtxContract from inside the store. I will refactor this into a hook (similar to connect from react-redux) to load instances at this point, and properly give the store at this moment only. The issue is coming from the store behing statically stored in the VtxContract class.

    I will keep you updated about this, but this means breaking changes

    Andrew Redden
    @androolloyd
    Ok thanks.
    Iulian Rotaru
    @mortimr
    2.1.1 is out, and a new module has been created => react-ethvtx, that contains the new HOC withContracts to inject VtxContract instances into component props (and store relying on a static store instance)
    and the documentation for the new contract handling is at http://doc.ethvtx.com/docs/react_intro
    Iulian Rotaru
    @mortimr
    and stop relying*
    Andrew Redden
    @androolloyd
    Things feel way faster after the update.
    I think the load contracts approach can be generalized a bit more.
    Iulian Rotaru
    @mortimr
    What have you got in mind ?