Skip to content

Instantly share code, notes, and snippets.

View smcatala's full-sized avatar
💭
SID rules

Stephane Catala smcatala

💭
SID rules
View GitHub Profile
@smcatala
smcatala / README.md
Created August 10, 2019 22:37
Strong typing of Redux actions and action-factories with Typescript conditional types: minimal boilerplate, helpful code-completion

Typescript conditional types provide a new approach to proper typing of Redux actions and action-factories.

Countless blogs and libraries have been written on this subject, trying to work around the limitations of the default type definitions of Redux. However, these numerous attempts to reduce boilerplate and to improve type cohesion unfortunately remained unsatisfactory without conditional types.

Working through our (enormous) backlog of unsorted TypeScript "Suggestions" and it's remarkable how many of them are solved by conditional types.

/**
* Copyright 2019 ZenyWay S.A.S., Stephane M. Catala
* @author Stephane M. Catala
* @license Apache Version 2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing,
/**
* Copyright 2019 ZenyWay S.A.S., Stephane M. Catala
* @author Stephane M. Catala
* @license Apache Version 2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing,
@smcatala
smcatala / README.md
Last active February 7, 2021 19:48
use @storybook/react (^5.1) with inferno & typescript
/**
 * Copyright 2019
 * @author Stephane M. Catala
 * @license Apache Version 2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
@smcatala
smcatala / keybase.md
Created November 6, 2017 23:41
Keybase proof

Keybase proof

I hereby claim:

  • I am smcatala on github.
  • I am smcatala (https://keybase.io/smcatala) on keybase.
  • I have a public key ASBVdRdmk5RaRIB048E1-5fy1BDXok6lnlIlPbx4xDS4wgo

To claim this, I am signing this object:

@smcatala
smcatala / <john.doe@example.com>.private.key
Last active November 30, 2016 10:31
easily run opgp-service in a web-worker with worker-proxy
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: GnuPG v1
lQc9BFggrQEBEAC9H7HUCc+pIBxbAoyKxR+8gNj2dB4vdwPqI51Ufsr4JpgMvRxB
HfX18Ua3GbFQiBmhSasmbk0yj26Gx9Y6+j7OKTIXzmCu80vFTRXqWQuJkfwv7+KK
fHX8TQ7D165g4ez+h+cQYBSli7OgCRzypd1EgNXUafs80ZFEv/fY05i1ElSIypDU
oyODa4IOxeRD2heQx4II/Qq74RfVikbv3S6zLeSA0lQdwjUSKG03qmfmu8S1Gtsn
ffO5+8LJSyN/BMEjvzm2oDdar49eVZjBOxIqPKh/Qh2WWDgNI9G3KtyIzXdqYKl4
9OgSBzJaumB+2OLLpJYHAVu/P2Rk4QtdjB6Tg4r4IYSn/G5Tu6pmjo+EnRVF+q4/
6jZLrYS1hd4a39wliYNuf7fcb/GTwdSoIkCO8wkpCyP9BW4QsX8j5tNbdpX2m3y+