Also, I'm checking how to create a .github repo so that we don't have to create CODE_OF_CONDUCT.md and such for every repo in our org.
2020-04-28 11929, 2020
v6lur joined the channel
2020-04-28 11941, 2020
Chinmay3199 joined the channel
2020-04-28 11925, 2020
Chinmay3199
Mr_Monkey: Can you tell how did we set VIAF and IMDb identifier for work 'The Martian' (https://beta.bookbrainz.org/work/7b5e4cad-2cb1-4d…) at the first place when there shouldn't have been an option to add IMDb and VIAF as identifiers while creating the work.
2020-04-28 11925, 2020
Mr_Monkey
Hi Chinmay3199! Those identifiers were set a while back, where there was no constraints to what entity an identifier could be applied to, I suppose (that was before my time)
2020-04-28 11939, 2020
Mr_Monkey
That's where the cleanup comes in :)
2020-04-28 11902, 2020
Chinmay3199
Oh got it now. Thanks!
2020-04-28 11942, 2020
iliekcomputers starts work on github bot thats takes jira tickets and solves them
2020-04-28 11944, 2020
d4rkie joined the channel
2020-04-28 11915, 2020
D4RK-PH0ENiX has quit
2020-04-28 11934, 2020
reosarevok
bitmap (or yvanzo): if you have some time to look at Cyna's open PR, would be nice to see if you also think it's ready :)
2020-04-28 11940, 2020
reosarevok
(or if I missed something)
2020-04-28 11927, 2020
alastairp
iliekcomputers: that's a pretty good one
2020-04-28 11900, 2020
shivam-kapila
A lot of BotBrainz in the past 2 days :)
2020-04-28 11938, 2020
yvanzo
reosarevok: there is an inconsistent use of addColonText, should we stop using it already?
2020-04-28 11950, 2020
reosarevok
Why would we?
2020-04-28 11951, 2020
yvanzo
(stop adding it at least)
2020-04-28 11917, 2020
reosarevok
I'd like to use it everywhere where we know there should be a string only, isn't that the point? Better typing?
2020-04-28 11954, 2020
reosarevok
Unless we agree we don't want it at all and then we should just mass-change it to addColon
here, I'm calling setState, and then a few lines later calling addMbid, but what I'm seeing is that in addMbid, the value of this.state.mbid is the _previous_ state
2020-04-28 11919, 2020
Mr_Monkey
setState is an asynchronous function, and it accepts an optional callback once the state has been set
2020-04-28 11930, 2020
alastairp
oooo, that's new to me
2020-04-28 11932, 2020
Mr_Monkey
I forget the exact signature in that case, give me a sec
2020-04-28 11949, 2020
alastairp
ahhh, this worked in the old version because I was using refs, not state
2020-04-28 11948, 2020
Mr_Monkey
Well, I guess the callback has no arguments, so `this.setState({myState: foo}, () => {state is updated here})`
2020-04-28 11900, 2020
alastairp
cool
2020-04-28 11914, 2020
alastairp
and in the callback I can call another function, this.blah() ?
2020-04-28 11927, 2020
Mr_Monkey
Yes. but don't call setState in it ;)
2020-04-28 11931, 2020
alastairp
see how in my addMbid function, I call setState again. is this allowed?
2020-04-28 11936, 2020
alastairp
grrr
2020-04-28 11938, 2020
Mr_Monkey
Negative :)
2020-04-28 11948, 2020
Mr_Monkey
So ComponentDidUpdate to the rescue
2020-04-28 11953, 2020
Mr_Monkey
> The second parameter to setState() is an optional callback function that will be executed once setState is completed and the component is re-rendered. Generally we recommend using componentDidUpdate() for such logic instead.
>You may call setState() immediately in componentDidUpdate() but note that it must be wrapped in a condition like in the example above, or you’ll cause an infinite loop.
2020-04-28 11904, 2020
Mr_Monkey
Basically, you check if the state has changed before calling setState again
2020-04-28 11908, 2020
alastairp
is there a shorthand for `function = () => { }` ?
2020-04-28 11956, 2020
Mr_Monkey
I guess arrow functions *are* the shorthand
2020-04-28 11904, 2020
Mr_Monkey
Unless I misunderstood the question
2020-04-28 11908, 2020
alastairp
mm
2020-04-28 11929, 2020
alastairp
I seem to recall seeing something like `function() => { }` maybe? for functions without any arguments
2020-04-28 11946, 2020
Mr_Monkey
`() => {}`
2020-04-28 11902, 2020
Mr_Monkey
drop the `function`
2020-04-28 11916, 2020
alastairp
sorry, `function` in this case was the name of a function, not the keyword
2020-04-28 11948, 2020
alastairp
OK, in the case that it's anonymous, you would do `foo('bar', () => {...} )` ?
2020-04-28 11950, 2020
shivam-kapila
Mr_Monkey: Doesnt the`function = () => { }` looks like arrow fxn with assignment?
2020-04-28 11903, 2020
alastairp
and named, it's `x = () => {...}` to make a function called x
2020-04-28 11903, 2020
Mr_Monkey
Both of thise things :D ^
2020-04-28 11908, 2020
Mr_Monkey
Exactly
2020-04-28 11915, 2020
alastairp
and if there are args, you put the args in ()
2020-04-28 11921, 2020
Mr_Monkey
correct
2020-04-28 11925, 2020
alastairp
thank you!
2020-04-28 11904, 2020
Mr_Monkey
Also, if you have a single argument, no need for parentheses: `foo('bar', fnord => {//do something with fnord} )`
2020-04-28 11914, 2020
shivam-kapila
I like arrow fxns. They have other advantages too.