« first day (3206 days earlier)      last day (1965 days later) » 

08:33
Guys I have very lame question on React. Please help
I have a textfield, which should show a text I am passing through props. If user edits it and the clicks somewhere else, it should again show the text from props. If user edits it and hits Enter key, it should set the props (parent's state)
08:47
Hi. What is the best way to drop collection if it exists?
@entithat Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
I mean I just want to run this line await connection.dropCollection('users'); but it will raise an error and the code after it won't execute. Is there any way to drop collection without error if it does not exist? (without using double try-catch block)
09:50
Hola. Quick google does not help me. How do I console.log something and have it persist after the render of the page. i.e. I need a console.log output of something just before the re-render, but I cannot see it because it happens too quick
guess alert can be an option
 
1 hour later…
11:07
@isquared-KeepitReal if I understand you right, you can just persist console logs in your browser's developer tools.
So in Chrome dev tools, the "Console" section has an option to "Preserve Log", which will keep the logs of the current page after a redirect.
 
5 hours later…
16:19
@entithat why isn't the top level try/catch not working for what you want? The catch block is so you can handles specific errors. You can also convert it away from async/await syntax and go with the original promise syntax. connection.dropCollection('users').then().catch()
17:00
@DavidKamer idk why parent try-catch doesn't throw error. anyway I will try with promises..
17:29
hey all
Hi guys, I hope you all find my message well. I am new to cloud native development. I want to follow a git repo which can guide me through project structure and other rules of product development. i understand java and design patterns, I am aware of ES5, ES6.
@NavdeepSingh Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
Hi Caprica. Thank you for sharing the rules.
17:47
@CapricaSix are you a real person?
i dont think so :)
lol
so I have a question
shoot please
I am get a response that requires setting httpheaders
it gives me a responding token
which is what I want
but i also want information from the actual response i.e. like status
I don't now I can get it
api url?
who is the producer of api
17:50
a temporary token generator
don't know what you would call that
jwt token?
no a bot framework token
oh, sorry man I am from Java/javascript/nodejs background
well this is angular so it is javascript
are you familiar with xhr?
may be if you have screen sharing , i can try helping.
skype?
17:54
huh
do you know angular
ping me on navdeep.singh.kanwal
no worries
@Wietlol yeaaaa
lol can you help with something really quick
with my Int32.MinValue good JavaScript experience?
im using an http.get(url, headers)
to get a token
it returns a token but i can't get the response information
like status 202
if (question.isReallyRelatedTo(javascript)) {
    redirectTo(otherPeople)
}
if there's an error then there is a response
huh
your question is entirely related to a particular javascript library
18:07
Hey guys, I'm looking at being able to understand node cpu profiling better

in this example: https://gist.github.com/dpchamps/9442f238c14ddc85fcecc8b7cd148edd
I know *why* the reduceFast is more performant than reduceSlow. But i would like to be able to explain why from the logs
of which I know nothing
I cant really help you there
more specifically, looking at the js top-down calls, what can i glean from the fact that two internal node calls (i'm assuming native library calls) .nvm/versions/node/v10.15.3/bin/node have such a drastic difference in execution times (25.5 seconds vs 84 ms)
@christan, share the url, your result will depend on the response from url
check the api documentation
i think it is a security thing
i have to set the headers
but xhr works fine
ok let me show the xhr portion and this might make more sense
//if (xhr.readyState == 4 && xhr.status == 200) {
            // var response = JSON.parse(xhr.responseText);
            // this.tempToken = response;
            // // console.log('response ', this.tempToken)
            // const directLine = window.WebChat.createDirectLine({
            //     secret: this.tempToken,
            //     webSocket: false
            // });
why would you need to add headers. every api is suppose to return http status code
which api you are using, if its not under any disclosure agreement, can you please share it
may be i can try myself
i think i know what's happening
// xhr.open('GET', "https://webchat.botframework.com/api/tokens", true);
// xhr.setRequestHeader('Authorization', 'BotConnector ' + 'VQDSUGBn3Lo.fgfgfggffg-g');
I think that open followed by the headerset is the issue
add Bearer in token,, try that
i believe you are doing nothing wrong
18:19
you mean before it
check the link i shared
and compare your code with the code snippet given on link
maybe what i am doing is this should be a post
is anybody there to help me with my react question
sure what's the question
@ChristianMatthew I have a textfield, which should show a text I am passing through props. If user edits it and the clicks somewhere else, it should again show the text from props. If user edits it and hits Enter key, it should set the props (parent's state)
18:30
so what's the issue
Like I am confused. If I put value={this.props.text} in textfield, I can't edit it.
do you know about binding
binding 'this'?
read this over
15
Q: React, Binding input values

Gabriel LopesI'm having some problems with binding the value of an input, I have done it on another component of my app and it worked fine, but somehow I can't get it works on another component. I'm only getting the first letter and not the whole text This is my component class Post extends Component { c...

Ugh thats not my question. You misunderstood
18:34
your typing in a field
that bind thing is solved by arrow functions
and you want that field to be set
correct
Let me explain
and then you want to go back to that field and edit it, hit enter and set it again
am I wrong?
lemme create a js fiddle
18:35
kk
ok i think my issue is this
Well. I have a parent component which got some property say "size". Then I have a child component TextField. Now size can be changed from outside as well as from textfield. If it changes from somewhere else, textfield should update accordingly.
as far as I am concerned xhr is just more robust than httpClient from angular
you're speaking about component communication which you should still go and read that article
however, with that said I think I should be using a post
instead of a get so I can actually send a payload to the api
yes. but I didn't get any article with such a complicated scenario
does that make sense, @Wietlol
I've seen usecases where the prop is updated only from textfield, so they just lift the state up
18:39
it's not that complicated of a scenario
18:52
@ChristianMatthew Hi, refer this : jsfiddle.net/protron/560fyjnp
So basically I want to make that textfield editable so that if I edit there and hit enter, the text value is updated everywhere
you are talking about state
you need to look at redux
that's your issue
without redux
and inter component communication
there probably is a way but look at react inter component communication
Could you please edit my fiddle to make it work?
I don't think its much work if you know how to do
I was thinking of making the TextField Uncontrolled component
lol what do you mean you're text binding in this fiddle
you dont' even have another component that is receiving or not recieving a value
18:55
button is the another component
click on the button and you'll see
i dont' see a button
sorry I didn't save ugh. wait a sec
Here
i have no idea what you're doing
you seem to need to work on a react tutorial to learn about what I was saying
If i click on button, it generates a random text and updates everywhere. you see?
18:58
I want the ability to edit text and hit enter and the text entered should be updated everywhere
and if that doesn't solve your problem I will give you $100
no go and come back when you're finished
how do you find tutorial links so fast?
@ChristianMatthew The concepts explained in this tutorial are already used by me. Like App component is rendering RandomButton and RandomButton can also communicate with App component. I don't think you even understood what the problem is in making the textfield editable
when you say make a text field editable
if it's a text field it is editable
if is disabled then it is not editable
Oh please! Try to edit
Go to my link and try to edit
I will give you $200 lol
you didn't the tutorial
100%
19:09
As soon as I want to make the TextField editable, I need to keep its own textValue state. And onChange function would update the textVal state, not the main text prop coming from Parent component. Now whenever App's text state changed, I need to update TextField's local textVal state as well. So i think I should pass a key to TextField component and make it uncontrolled component
and the majority of your code is doing nothing and makes no sense
do the tutorial
it has redux in it
it communicate between components
you are not using a text field you're using a button bound to a textfield
@ChristianMatthew I did. And I am so done with you. Redux is not necessary thing. Go to my link and make my textfield work if you are so great
I am not using a button bound to text field check my code,. WTF
it's probably not but what you're doing doesn't make sense
Remove the button
Nvm goodbye,. like wtf
what is it that you want to do
19:12
And the tutorial you provided explains the most basic thing.
you want to edit a text field
like enter in a word and then save it
and it appear in other places of the app
i.e. box down below a header up above
is that what you're saying
I want to type "23" in textfield, hit enter and on button should alos appear "23" written
so why do you have a randomizer on the button that changes the text field?
19:16
Thats just a demo to show how other components can also change the app's main state omg
I only wanted some other component to change the App's text state.
So I used that Random button
Because that was the easiest component I could make for fiddle
I thought this link is what would solve my issue, and came here just to confirm if there is some standard way
@RahulJain first off you were setting a value in the input
that's why you couldn't edit it
what you want to use is a placeholder=4
is that what you want
you also forgot to save?
but that is pretty much what you want
no. your button isn't changing the text
@ChristianMatthew I wanted this: jsfiddle.net/fgam3uc5/1
But I kinda felt like my way is not a good way
I can see a lot of failure cases already
19:32
well you got it
No. Try backspace on text field. It never empties it. And many other cases. There must be some standard way
take out the default value
what about that
you could edit it to only use the value when you are setting it from the button
something like that
Thanks
does that work
But I don't think setting state undefined is good thing. Basically our textVal state is sometimes derived from parent props. I should try reactjs.org/blog/2018/06/07/…
19:41
whatever works if you think you exhausted all possibilities its ok to ask the question and post code snippets on SO
@ChristianMatthew :P I have been banned a lot. Like I couldn't explain my question to you until I made it myself. I am bad at communication and all
i know its rough sometimes I get picked on for questions too
@ChristianMatthew Btw I am really thankful you kept helping. I appreciate that :)
it's amazing what people won't help with when they assume you dont' know what it is that you're asking
or rather they don't know what you're asking
that is why i push for questions to see what it is your asking and what it is I might be able to help with
yeah. During interviews I keep clearing what exactly the question is
@ShrekOverflow They don't need to read it "together" :P
19:47
what do you mean clearning the question
@ChristianMatthew to make it clear what exactly the question is
@wietol
I figured it out
  get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
get has all of these overloads
 
2 hours later…
22:19
0
Q: ReactJS typescript deployment with PHP Laravel goes white screen with no errors?

Ben BeriI have a working reactjs project that I created with create-react-app --typescript option. when running npm run start my app works completely fine. When doing npm run-script build my app builds fine aswell with a few in-component warnings that are not really relevant because I get them on devel...

23:13
no coders today

« first day (3206 days earlier)      last day (1965 days later) »