Redux Saga Snippets
Features
exaction →
// input
export const get_foo = "get_foo";
// output
export const GET_FOO = "GET_FOO";
reaction →
// input
export function get_foo(foo, bar,) {
return {
foo, bar,
type: get_foo
};
};
// output
export function getFoo(foo, bar) {
return {
foo,
bar,
type: GET_FOO,
};
};
saga →
export function* callFoo() {
while (true) {
const { payload } = yield take(ACTION);
}
}
Prefix |
Method |
yp → |
yield put({ payload, type: ACTION }); |
yc → |
yield call(() => func()); |
cyc → |
const res = yield call(() => func()); |
cys → |
const selector = yield select((state) => state.property); |
cyt → |
const { payload } = yield take(ACTION); |
Release Notes
Feel to free to fork my repo and if I like it I'll merge it in.
Enjoy!
Support Open Source Code by buying me a drink ⚡🥤 😉.
| |