Bawdy Ink Slinger
Bawdy Ink Slinger
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/10/2023 in #front-end
Are DOM modifications synchronous?
I don't know the correct terminology, but I meant, "Is the mutating/accessing in separate async code?"
16 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/10/2023 in #front-end
Are DOM modifications synchronous?
Ok that's really weird, everything I'm throwing at it now works as if updates happen immediately but I have absolutely come across issues with wanting to access something that was just added and being unable to do so. I don't know if it is old depreciated behaviour or not
Is there a chance that one thread was mutating and another was accessing?
16 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
How do I build an API that lets me do `await t.a().b()` & `await t.a(); await t.b()`?
@Rägnar O'ock thanks! I'll check these out soon
38 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/10/2023 in #front-end
Are DOM modifications synchronous?
of course. I forgot it was there
16 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/10/2023 in #front-end
Are DOM modifications synchronous?
Yes, DOM changes are part of the event loop. As such if you make changes to the DOM the next line will consistently be unaware of the change you have made
Hm. Why is it that this prints 1 when I run it as one line in the console? document.body.append(document.createElement("div")); console.log(document.querySelectorAll("div").length);
16 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/10/2023 in #front-end
Are DOM modifications synchronous?
@Jochem done. sorry
16 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
thank you for the help 🙂
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
well here's what my code does now:
console.log(`inspecting TestController: `, inspect(TestController, { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController: `, inspect(new TestController, { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController(): `, inspect(new TestController(), { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController().click: `, inspect(new TestController().click, { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController().click(): `, inspect(new TestController().click, { showHidden: true, showProxy: true, getters: true, depth: null}));

/*
inspecting class name: <ref *1> [class TestController] {
[length]: 0,
[name]: 'TestController',
[prototype]: {
[constructor]: [Circular *1],
[click]: [Function: click] { [length]: 1, [name]: 'click' },
[expect]: [Function: expect] { [length]: 1, [name]: 'expect' }
}
}
inspecting new class name: TestController {}
inspecting new class name(): TestController {}
inspecting new class name().click: [Function: click] { [length]: 1, [name]: 'click' }
inspecting new class name().click(): [Function: click] { [length]: 1, [name]: 'click' }
*/
console.log(`inspecting TestController: `, inspect(TestController, { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController: `, inspect(new TestController, { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController(): `, inspect(new TestController(), { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController().click: `, inspect(new TestController().click, { showHidden: true, showProxy: true, getters: true, depth: null}));
console.log(`inspecting new TestController().click(): `, inspect(new TestController().click, { showHidden: true, showProxy: true, getters: true, depth: null}));

/*
inspecting class name: <ref *1> [class TestController] {
[length]: 0,
[name]: 'TestController',
[prototype]: {
[constructor]: [Circular *1],
[click]: [Function: click] { [length]: 1, [name]: 'click' },
[expect]: [Function: expect] { [length]: 1, [name]: 'expect' }
}
}
inspecting new class name: TestController {}
inspecting new class name(): TestController {}
inspecting new class name().click: [Function: click] { [length]: 1, [name]: 'click' }
inspecting new class name().click(): [Function: click] { [length]: 1, [name]: 'click' }
*/
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
hm
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
I don't see that as an option to show in inspect either?
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
[Function: click]
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
I guess I'll create an empty constructor and see if that changes anything
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
I would've assumed inspect would have shown me
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
🙂
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
I know how to read the rest of this output but I don't know what it tells me re: new TestController() returning an empty object
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
okay
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
So many questions, but is [constructor]: [Circular *1], normal?
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
hm...
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
console.log(inspect(TestController, { showHidden: true, showProxy: true, getters: true, depth: null}));
/*
<ref *1> [class TestController] {
[length]: 0,
[name]: 'TestController',
[prototype]: {
[constructor]: [Circular *1],
[click]: [Function: click] { [length]: 1, [name]: 'click' },
[expect]: [Function: expect] { [length]: 1, [name]: 'expect' }
}
}
*/
console.log(inspect(TestController, { showHidden: true, showProxy: true, getters: true, depth: null}));
/*
<ref *1> [class TestController] {
[length]: 0,
[name]: 'TestController',
[prototype]: {
[constructor]: [Circular *1],
[click]: [Function: click] { [length]: 1, [name]: 'click' },
[expect]: [Function: expect] { [length]: 1, [name]: 'expect' }
}
}
*/
87 replies
KPCKevin Powell - Community
Created by Bawdy Ink Slinger on 10/4/2023 in #back-end
If `console.dir(x, {showHidden: true, });` prints `TestController {}`, does that mean x empty?
the typescript compiler says click doesn't exist. I can for it to run anyway if you want.
87 replies