You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have Found Following Syntax Errors in the module.
First One:
conversationsClient.listen().then(clientConnected, function (error) {
look at the above line. here, the function clientConnected is called without parenthesis
and the Right way is
conversationsClient.listen().then( clientConnected() , function (error) {
Second One:
conversationsClient.inviteToConversation(inviteTo, options).then(conversationStarted, function (error) {
Here, the function conversationStarted is called without parenthesis, also parameter conversation is not passed
and the Right way is
conversationsClient.inviteToConversation(inviteTo, options).then(conversationStarted(conversationParameter), function (error) {
and I don't know what to pass as conversationParameter. If anyone knows, Please let me know.
The text was updated successfully, but these errors were encountered:
Hey @Barathiraja I'm not a developer at Twilio, but I do have experience in JS. The code here is perfectly fine because, in JS, functions can be passed as variables without calling them.
listen().then wants a function to run after the conversationsClient starts listening. clientConnected is the function we want to run after we start listening, so we pass it without parens to the .then function. If we used the parens, we would evaluate clientConnected and then pass the output of that function to the .then method, but .then expects a function that it runs by itself.
It's the same for the second, except the .then method passes conversationsStarted the conversationsParameter automatically.
Hi,
I have Found Following Syntax Errors in the module.
First One:
conversationsClient.listen().then(clientConnected, function (error) {
look at the above line. here, the function clientConnected is called without parenthesis
and the Right way is
conversationsClient.listen().then( clientConnected() , function (error) {
Second One:
conversationsClient.inviteToConversation(inviteTo, options).then(conversationStarted, function (error) {
Here, the function conversationStarted is called without parenthesis, also parameter conversation is not passed
and the Right way is
conversationsClient.inviteToConversation(inviteTo, options).then(conversationStarted(conversationParameter), function (error) {
and I don't know what to pass as conversationParameter. If anyone knows, Please let me know.
The text was updated successfully, but these errors were encountered: