Over unnecessary "async methods" causing a cascade of others unnecessary "async await". #852
howmarketing
started this conversation in
Polls
Replies: 1 comment 1 reply
-
The issue here is that a key store could be async. Consider reading from disk or local storage. So while this is an instance where it is unnecessary, the abstract class must be async to account for the async implementations: near-api-js/src/key_stores/keystore.ts Lines 9 to 16 in 6f83d39 Async adds complexity, but components like a key store are fundamentally I/O interfaces and thus async is always better than sync since you don't want to block the main thread. That is unless you want to add something like a web worker, but now the complexity increases again. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please, leave your consideration’s and vote
Unnecessary "async await" in cascade to package forced from implemented key_stores library
That’s causing a lot of unnecessary async await usages, what being increased difficulty’s to project as it is getting bigger and to implement the package.
Cascade start:
Class: InMemoryKeyStore
Methods example:
setKey
getKey:
removeKey:
clear:
...Rest
2 votes ·
Beta Was this translation helpful? Give feedback.
All reactions