Skip to content

Instantly share code, notes, and snippets.

View emyann's full-sized avatar
🏠
Working from home

Yann RENAUDIN emyann

🏠
Working from home
View GitHub Profile
import { combineReducers } from 'redux';
import { default as calls } from '../calls/calls.reducer';
const rootReducer = combineReducers({
calls
});
export type AppState = ReturnType<typeof rootReducer>;
export default rootReducer;
// actionCreators.ts
import { Action } from 'redux';
import { ThunkAction } from 'redux-thunk';
import { AppState } from './rootReducer';
export type AppAction<A = Action, P = any> = A & { payload: P };
export function makeActionCreator<P, T extends string = string>(type: T) {
function actionCreator(payload?: P): AppAction<Action<typeof type>, P> {
return {
@emyann
emyann / StateMachine.ts
Created February 20, 2019 23:40
Jive State Machine
// XState https://statecharts.github.io/xstate-viz/
const lightMachine = Machine({
id: 'light2',
initial: 'standing',
states: {
standing: {
on: { startOutgoingCall: 'waitForAnswer' },
on: { startIncomingCall: 'ringing' }
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.morphism=e():t.morphism=e()}(this,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){retur