Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial Account Kit #7

Merged
merged 10 commits into from Oct 20, 2022
Merged

Initial Account Kit #7

merged 10 commits into from Oct 20, 2022

Conversation

dafuga
Copy link
Contributor

@dafuga dafuga commented Oct 5, 2022

issue #6

02-getting-account-data/index.js Outdated Show resolved Hide resolved
02-getting-account-data/index.js Outdated Show resolved Hide resolved
02-getting-account-data/index.js Outdated Show resolved Hide resolved
02-getting-account-data/index.js Outdated Show resolved Hide resolved
02-getting-account-data/index.js Outdated Show resolved Hide resolved
@dafuga
Copy link
Contributor Author

dafuga commented Oct 18, 2022

@aaroncox @jnordberg I removed a lot of the methods and addressed some of your feedback. Let me know if you guys think that we can merge this.

@aaroncox
Copy link
Member

I'd merge it since ultimately it doesn't matter, but if we merge now we'd lose some of the comments that are still unaddressed. I'd say let's resolved those first. I can take a shot at it if you'd like and add some commits to this branch?

const account: Account = Account.from('teamgreymass', Chains.EOS)

// Retrieves data from the APIs (v1/chain/get_account)
await account.loadData()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Continuing from the other thread - the above takes the Account and makes it a representation of an account, and then has a loadData method to make the API call and populate the data.

I'm not sure if we want to use this pattern. It has it's pros/cons.

  • Pro: Allows you to just call loadData to load/refresh the Account data. Could have a timestamp to indicate some form of staleness.
  • Con: Always feels weird to just await an async function like this to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually lets continue this discussion in a new PR. I'm going to merge this.

If anyone has suggestions on how this best changes, open a PR!x

@aaroncox aaroncox changed the title Added Account class examples Initial Account Kit Oct 20, 2022
const account: Account = Account.from('teamgreymass', Chains.EOS)

// Retrieves data from the APIs (v1/chain/get_account)
await account.loadData()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally would prefer not having this extra step where you need to load the data manually.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure its great either - but this was the latter option Johan has mentioned.

@aaroncox aaroncox merged commit 28cf39d into main Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants