Closed aaroncox closed 1 year ago
Was working on a test script that utilized the Contract Kit and needed to load the data from the globals table on the eosio contract. This table only has one row and I just needed to load it.
globals
eosio
In the current dev version, what I had to do was:
dev
const table = contract.table('global') return (await table.first(1).next())[0]
The syntax here was kinda messy and I just wanted one row - so my solution was to make the query parameter on the get call optional, which leads to:
get
const table = contract.table('global') return await table.get()
Thoughts?
Was working on a test script that utilized the Contract Kit and needed to load the data from the
globals
table on theeosio
contract. This table only has one row and I just needed to load it.In the current
dev
version, what I had to do was:The syntax here was kinda messy and I just wanted one row - so my solution was to make the query parameter on the
get
call optional, which leads to:Thoughts?