Skip to content

Instantly share code, notes, and snippets.

View JWLangford's full-sized avatar

Jesse Langford JWLangford

View GitHub Profile
const numInt = "10"
const convertedInt = +numInt
// 10
const numFloat = "10.51"
const convertedFloat = +numFloat
// 10.51
const notANumber = "chicken"
const convertedNaN = +notANumber
const numInt = "10"
const convertedInt = parseFloat(numInt)
// 10
const numFloat = "10.51"
const convertedFloat = parseFloat(numFloat)
// 10.51
const notANumber = "chicken"
const convertedNaN = parseFloat(notANumber)
const numInt = "10"
const convertedInt = parseInt(numInt)
// 10
const numFloat = "10.51"
const convertedFloat = parseInt(numFloat, 10)
// 10
const notANumber = "chicken"
const convertedNaN = parseInt(notANumber)
const numInt = "10"
const primitiveInt = Number(numInt)
// 10
const numFloat = "10.51"
const primitiveFloat = Number(numFloat)
// 10.51
const notANumber = "chicken"
const primitiveNaN = Number(notANumber)
import styled from "styled-components";
interface ILoading {
loading: boolean;
}
interface IProps extends ILoading {
data: any;
}
import styled from "styled-components";
interface ILoading {
loading: boolean
}
const Loader = styled.div<ILoading>`
display: ${(props) => (props.loading ? "block" : "none")};
`;
import styled from "styled-components";
const Loader = styled.div`
display: ${(props) => (props.loading ? "block" : "none")};
`;
export const Loader = (props) => {
const { loading } = props;
return (
interface UserBase {
username: string
email: string
status: string
}
interface SliceBase {
loading: boolean
error: boolean
errorMessage: string
}
interface ModalBase {
open: boolean
setOpen(open: boolean): void
}