Skip to content

Commit 78617a8

Browse files
committed
Web.AsyncHTTP: Rename callback key to userCallback.
1 parent 408d7c2 commit 78617a8

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

autoload/vital/__vital__/Web/AsyncHTTP.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ function! s:_request_cb(settings, responses, exit_code) abort
3535

3636
call map(a:responses, 's:Core.build_response(v:val[0], v:val[1])')
3737
let last_response = s:Core.build_last_response(a:responses)
38-
if has_key(a:settings, 'user_cb')
39-
call a:settings.user_cb(last_response)
38+
if has_key(a:settings, 'userCallback')
39+
call a:settings.userCallback(last_response)
4040
endif
4141
endfunction
4242

doc/vital/Web/AsyncHTTP.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ request({method}, {url} [, {settings}])
4646
4747
call s:AsyncHTTP.request({
4848
\ 'url': 'https://example.com',
49-
\ 'user_cb': function('s:user_cb'),
49+
\ 'userCallback': function('s:user_cb'),
5050
\ })
5151
<
5252
{settings} is a |Dictionary| which contains the following items:
@@ -128,7 +128,7 @@ request({method}, {url} [, {settings}])
128128
"unixSocket" Default: (None)
129129
Use --unix-sokect (only curl >= 7.40.0)
130130

131-
"user_cb" Default: (None)
131+
"userCallback" Default: (None)
132132
A |function| of callback function called when the process
133133
outputs some data. The callback function has one argument,
134134
response(|Dictionary| of response).

test/Web/AsyncHTTP.vimspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Describe Web.AsyncHTTP
9090
let response = AsyncHTTP.request({
9191
\ 'url': 'file:///' .. current_dir .. '/test/_testdata/Web/test.html',
9292
\ 'client': ['curl'],
93-
\ 'user_cb': function('s:user_cb'),
93+
\ 'userCallback': function('s:user_cb'),
9494
\ })
9595

9696
call s:wait_until({-> g:response !=# {}}, 1000)

0 commit comments

Comments
 (0)