Skip to content

Commit 2c983d8

Browse files
Subramanya Chakravarthy NookalaSubramanya Chakravarthy Nookala
Subramanya Chakravarthy Nookala
authored and
Subramanya Chakravarthy Nookala
committed
More changes
1 parent 4a8d672 commit 2c983d8

File tree

5 files changed

+31
-43
lines changed

5 files changed

+31
-43
lines changed

Diff for: app/JavaScript/example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let person = {
2323

2424
// Object type by property
2525
/**
26-
* @typedef {Object<String, any>} Car
26+
* @typedef {Object} Car
2727
* @property {string} model
2828
* @property {number} make
2929
*/

Diff for: slides/assets/satan-hail.webp

152 KB
Binary file not shown.

Diff for: slides/assets/summary.png

394 KB
Loading

Diff for: slides/assets/type-comparision.png

49.4 KB
Loading

Diff for: slides/presentation.mdx

+30-42
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Software Developer **👨‍💻** @CoWrks
3737

3838
# Why?
3939

40+
<img src={"./assets/satan-hail.webp"} width={500} />
41+
42+
---
43+
44+
# Why?
45+
4046
<ul>
4147
<Appear>
4248
<li> Early detection of type errors</li>
@@ -57,6 +63,12 @@ Software Developer **👨‍💻** @CoWrks
5763

5864
---
5965

66+
# Comparison
67+
68+
![comparision](./assets/type-comparision.png)
69+
70+
---
71+
6072
### Getting Types right is hard
6173

6274
![Typechecking for javascript can sometimes be intimidating](./assets/newtypechecker.png)
@@ -236,8 +248,8 @@ class Person {
236248
}
237249

238250
const guy = new Person({
239-
name: Sam,
240-
age: 32
251+
name: "Subramanya",
252+
age: 25
241253
})
242254
guy.sayName()
243255
```
@@ -260,7 +272,7 @@ JsDoc for classes
260272
/**
261273
* @type {Options} opts
262274
*/
263-
const opts = { firstName: "Joe", lastName: "Bodoni", age: 32 }
275+
const opts = { firstName: "Subramanya", lastName: "Chakravarthy", age: 25 }
264276
```
265277

266278
---
@@ -380,46 +392,16 @@ const btn = document.createElement('button')
380392

381393
---
382394

383-
export default FullScreenCode
395+
### You can import from another file
384396

385397
```javascript
386398
/**
387-
* Props define attributes on a virtual node.
388-
* @typedef {Object.<string, any> | {}} Props
389-
* @property {Children} Props.children
390-
*/
391-
/**
392-
* The vnode children of a virtual node.
393-
* @typedef {VNode[]} Children
394-
*/
395-
/**
396-
* Define a custom type for virtual nodes:
397-
* @typedef {string | number | Function} Type
398-
* @typedef {Object.<string, any>} VNode
399-
* @property {Type} VNode.type
400-
* @property {Props} VNode.props
401-
* @property {Children} VNode.children
402-
* @property {Key} [VNode.key]
399+
* @param {import("react").ChangeEvent<HTMLInputElement>} event
403400
*/
404-
```
405-
406-
---
407-
408-
You can import from another file
409-
410-
```javascript
411-
import { createVNode } from '../vnode'
412-
/**
413-
* @typedef {import('./vnode').VNode} VNode
414-
*/
415-
416-
// Some code that create options for createVNode to use.
417-
const options = ...
418-
/**
419-
* @param {Object<string, any>} options
420-
* @return {VNode} VNode
421-
*/
422-
const vnode = createVNode(options)
401+
handleChange = event => {
402+
const { value } = event.target
403+
this.setState(() => ({ description: value }))
404+
}
423405
```
424406

425407
---
@@ -438,14 +420,20 @@ const price = 12 // or '12'
438420
* @type {{name: string}, {age: number}}
439421
*/
440422
const person = {
441-
name: "Joe",
442-
age: 32
423+
name: "Subramanya",
424+
age: 25
443425
}
444426
```
445427

446428
---
447429

448-
### Let's Dig into react
430+
### Let's Do Live Coding
431+
432+
---
433+
434+
### Summary
435+
436+
![JSDoc](./assets/summary.png)
449437

450438
---
451439

0 commit comments

Comments
 (0)