Skip to content

Instantly share code, notes, and snippets.

View dennis-8's full-sized avatar

Dennis N. dennis-8

View GitHub Profile
@dennis-8
dennis-8 / redux-actions.ts
Created June 6, 2019 14:55 — forked from milankorsos/redux-actions.ts
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
@dennis-8
dennis-8 / enzyme-cheatsheet.js
Created April 20, 2019 07:49 — forked from jahe/enzyme-cheatsheet.js
Enzyme Cheatsheet
// Show rendered HTML
const wrapper = shallow(<App />)
console.log(wrapper.debug())
// Disable lifecycle methods of react within tests
const wrapper = mount(<App />, { disableLifecycleMethods: true })
// Assert number of occurrences
expect(wrapper.find('p').length).toBe(1)
@dennis-8
dennis-8 / laravel-queue.service
Created February 9, 2017 15:40 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker