-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add template function getBlock
#14474
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
Comments
我在用这个:
只要有绑定块就可以直接用块 ID 了 |
仅仅这样是不够的。默认的 我的异议是,使用 在数据库操作中,通常我们只需要获取一个块,因此 即使按照你的方案,在判断块绑定之后,仍然需要通过 |
至少不需要查数据库就知道 ID 是否有效( |
这个确实是一个明显的优点 |
获取块以后直接用就行了,和 queryBlocks 返回的对象结构一样。 |
哦我懂了,这两个差不多等价:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
添加模板函数,用于快速获取数据库列行所绑定的块
In what scenarios do you need this feature?
使用数据库模板列的时候,基本常用操作就是:
这个操作实在过于常见,所以我建议干脆直接封装一个模板函数简化一下操作算了
Describe the optimal solution
添加一个函数,例如
getBlock
或thisBlock
等。该函数的输入参数为一个包含
id
属性的对象{ id: "..." }
。函数会查询对应的块,如果不存在则返回
null
。这样可以适当简化代码:
Describe the candidate solution
No response
Other information
No response
The text was updated successfully, but these errors were encountered: