Skip to content

Instantly share code, notes, and snippets.

View pgangwani's full-sized avatar
🎯
Focusing

Pawan Gangwani pgangwani

🎯
Focusing
View GitHub Profile
@pgangwani
pgangwani / redux-saga-confirmation-dialog.js
Created March 14, 2019 15:02 — forked from tomkis/redux-saga-confirmation-dialog.js
Implementing confirmation dialog via redux-saga
import { select, put, take } from 'redux-saga/effects';
function* emptySaga() {}
export function* withConfirmation(text, onConfirm, onCancel = emptySaga) {
yield put({ type: 'ShowConfirmationDialog', payload: text });
const { type } = yield take([
'ConfirmationDialogConfirmed',
'ConfirmationDialogCanceled'
@pgangwani
pgangwani / Regex.txt
Last active August 31, 2020 18:16
Regex Cheat sheet
Cheat Sheet
Character classes
. any character except newline
\w \d \s word, digit, whitespace
\W \D \S not word, digit, whitespace
[abc] any of a, b, or c
[^abc] not a, b, or c
[a-g] character between a & g
Anchors
^abc$ start / end of the string