Skip to content

使用RequestOptions.optionOf,预览时候报错 #19

Closed Answered by junerver
danatechgithub4 asked this question in Q&A
Discussion options

You must be logged in to vote

因为这次不只是 Option 用到了反射, asSuspendNoopFn也使用了反射,而且 option内部还有反射创建的 option (这里应该有一个无奈的表情)

稍后我会更新一个新的快照版本,之后需要按照如下进行修改:

// before

val (repoInfo, loading, error, request) = useRequest(
    requestFn = WebService::repoInfo.asRequestFn(),
    optionsOf {
        manual = true
        defaultParams =
            arrayOf(
                "junerver",
                "ComposeHooks"
            ) // Automatically requests must set default parameters
    }
)


// after
val (repoInfo, loading, error, request) = useRequest(
    requestFn = {
        NetApi.SERVICE.repoInfo(it[0] as String,it[1] as String)
    },
    RequestOptions.optionOf {
        manual = true
        defaultParams =
            array…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@junerver
Comment options

Answer selected by junerver
@danatechgithub4
Comment options

@junerver
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement(需求建议) New feature or request
2 participants