You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.
When reading data from a mapping, I must pass an argument as the key of the mapping. How do I get access to this getter getContractData?
<template><div><h3>Events</h3><p>Number of events: {{ eventIndex }}</p><p>Event: {{ event }}</p></div></template><script>import{mapGetters}from"vuex";exportdefault{name: "EventList",computed: {
...mapGetters("contracts",["getContractData"]),eventIndex(){consteventIndex=this.getContractData({contract: "EventFactory",method: "eventIndex"});returneventIndex;},event(){constevent=this.getContractData({contract: "EventFactory",method: "events",// How to dynamically query an event?});},created(){this.$store.dispatch("drizzle/REGISTER_CONTRACT",{contractName: "EventFactory",method: "eventIndex",methodArgs: []// No args required for this method});this.$store.dispatch("drizzle/REGISTER_CONTRACT",{contractName: "EventFactory",method: "events",methodArgs: [0]// How to store all the events in the store?});}};</script>
Note: I don't want to use the drizzle components as I want to be able to style them individually.
The text was updated successfully, but these errors were encountered:
I've been grinding on this same question for about 20 hours now. I feel like I'm taking crazy pills. I can see that the data gets cached but I can't figure out how I'm supposed to be juggling keys. Either I'm missing something for this library is missing something.
I ultimately gave up on the Drizzle-Vue plugin altogether. It seems that the implementation is incomplete. Even if the plugin had worked smoothly for my needs, this solution spins up two stores and attempts to keep them in sync. This is certainly less than ideal. I do not know of a circumstance where I would recommend this plugin to anyone.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Let's assume we have the following smart contract:
When reading data from a mapping, I must pass an argument as the key of the mapping. How do I get access to this getter
getContractData
?Note: I don't want to use the drizzle components as I want to be able to style them individually.
The text was updated successfully, but these errors were encountered: