Skip to content

Yt script#8

Open
ibrkhalil wants to merge 5 commits into
developfrom
YTScript
Open

Yt script#8
ibrkhalil wants to merge 5 commits into
developfrom
YTScript

Conversation

@ibrkhalil
Copy link
Copy Markdown
Owner

No description provided.

@ibrkhalil ibrkhalil requested a review from mcherri October 4, 2021 10:23
Copy link
Copy Markdown
Collaborator

@mcherri mcherri left a comment

Choose a reason for hiding this comment

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

Please fix.

m.top.response = response
return response
end if
m.top.response = response
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

response can be uninitialized here.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

yeah, we don't need it's return

Comment on lines +4 to +8
m.http.request = { payload: {
userId: 1,
title: "WOW, IT WORKED ^_^",
}, url: "https://jsonplaceholder.typicode.com/albums", requestType: "GET"}
m.global.http.observeFieldScoped("response", "useResponse")
}, url: "https://www.youtube.com/watch?v=1FL22N1EXDo", requestType: "GET" }
m.http.observeFieldScoped("response", "useResponse")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should request after we observe the field.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

done

Comment on lines 32 to 33
requestId = httpRequest.getIdentity().ToStr()
m.urlRequest[requestId] = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Better:

    m.urlRequest[httpRequest.getIdentity().ToStr()] = {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Done

return response
end if
m.top.response = response
return response
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this mean that we can handle only a single request? If yes then m.urlRequest AA is useless.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I guess we'll save the request's result in the response's AA and after resolving it we'll clear it's index

<field id="request" type="assocarray" />
<field id="response" type="assocarray" />
</interface>
<children></children>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No needed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Got it

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.

2 participants