Skip to content

Instantly share code, notes, and snippets.

View SeanCassiere's full-sized avatar
🥰
Typescript

Sean Cassiere SeanCassiere

🥰
Typescript
View GitHub Profile
@SeanCassiere
SeanCassiere / parse-and-replace-string-variables.ts
Last active May 30, 2023 09:08
Parsing and replacing marked tags with values from an object
const dataObject = {
firstName: "John",
lastName: "Doe",
// age // the parse fn will attempt to access this variable which does not exist
fullName: "John Doe",
};
type DataObjectInput = Record<string, string | number | null>;
function parseStringWithTemplateLiteralVariables(rawString = "", variables: DataObjectInput = {}) {
@SeanCassiere
SeanCassiere / React-Native on M1
Created November 20, 2021 22:30
The steps I take to solve the Pod Install Error on my M1 Mac.
# React Native on M1
Currently, when I scaffold a React Native application using the CLI, I am unable to complete the pod install for iOS.
## What I do to solve this?
1. After the Pod Install from the CLI fails, `cd` into the `ios` folder.
2. Open the terminal in Rosetta.
3. Deintegrate Pod.
```bash
pod deintegrate
```
@SeanCassiere
SeanCassiere / App.tsx
Created September 9, 2021 07:55
Auto-Fetch new access token
import { useDispatch, useSelector } from "react-redux";
// import { userFetchRefreshedAccessTokenThunk } from redux-thunks-location
const App = () => {
const dispatch = useDispatch()
const { token, tokenExpiresIn, isLoggedIn } = useSelector(reduxAuthUserSlice)
// auto refreshing the access token
useEffect(() => {