/components
- a page where we list all our components
the sweet spot where magic happens ✨
Installation
import PresentationListItem from "../../components/PresentationListItem";
export default {
component: PresentationListItem,
};
export const DefaultState = () => (
<PresentationListItem
date={new Date().toString()}
index={0}
name={"Some Presentation"}
pages={10}
/>
);
import PresentationListItem from "../../components/PresentationListItem";
//1. metadata
export default {
component: PresentationListItem,
};
// 2. named export - story
export const DefaultState = () => (
<PresentationListItem
date={new Date().toString()}
index={0}
name={"Some Presentation"}
pages={10}
/>
);
Build a desktop app for video/audio calling
- MacOs - Swift
- Windows - C#
query = "INSERT INTO users(name, age) VALUES('sanyam', 12) -> OK
query = `INSERT INTO users(name, age) VALUES(${name}, ${age})` -> Not Okay!
can result in sql injection
solution - use parameterized queries
const text = 'INSERT INTO users(name, email) VALUES($1, $2) RETURNING *'
const values = ['brianc', 'brian.m.carlson@gmail.com']
query(text, values)
sql injection & parameterised query
input | ||
---|---|---|
uuid | string | |
json/jsonb | object using JSON.parse() | string |
date,timestamp,timestamptz | Date object |