Skip to content

Instantly share code, notes, and snippets.

View ducin's full-sized avatar
🛠️
creatin' some stuff

Tomasz Ducin ducin

🛠️
creatin' some stuff
View GitHub Profile
@ducin
ducin / ^.md
Last active January 12, 2022 13:29
Functional Composition with Static Types in TypeScript, Tomasz Ducin, Warsaw TypeScript #2, 2019.02.06
@ducin
ducin / ^.md
Last active October 30, 2021 11:58
Functional Composition with Static Types in TypeScript, Tomasz Ducin, Wrocław TypeScript #3, 2019.03.27
@ducin
ducin / actions.ts
Last active February 15, 2021 01:02
redux setup
import { INC } from './constants';
export const Inc = () => ({
type: INC as typeof INC
})
export type Actions =
| ReturnType<typeof Inc>
@ducin
ducin / ecommerce-order.json
Created January 26, 2020 17:12
various json schemas
{
"type": "object",
"properties": {
"orderId": {
"type": "string",
"faker": "random.uuid"
},
"customer": {
"type": "string",
"faker": "name.findName"
@ducin
ducin / machine.js
Last active May 26, 2021 22:51
Generated by XState Viz: https://xstate.js.org/viz
// CORRECT SUBMIT EVENT:
// {
// "type": "SUBMIT",
// "password": "1234"
// }
// pure mocks
const delay = (time) => {
return new Promise((res, rej) => {
@ducin
ducin / machine.js
Last active May 26, 2021 22:47
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'AuthorizeDevice',
initial: 'chooseMethod',
states: {
chooseMethod: {
on: {
CHOOSE_ALLOW_ONCE: 'allowOnceToken',
CHOOSE_ADD_DEVICE: 'addDeviceForm',
CHOOSE_LOGOUT: 'loggedOut',
}
@ducin
ducin / machine.js
Last active May 26, 2021 22:43
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'AuthorizeDevice',
initial: 'chooseMethod',
states: {
chooseMethod: {
on: {
CHOOSE_ADD_DEVICE: 'addDeviceForm',
}
},
addDeviceForm: {