This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Effect, Event, sample, Store, Unit } from "effector" | |
declare let unit: Unit<number> | |
declare let store: Store<number> | |
declare let event: Event<number> | |
declare let effect: Effect<number, number> | |
store = sample(store) | |
store = sample(store, store) | |
event = sample(store, event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Tuple<T = unknown> = [T] | T[] | |
type Tail<A extends Tuple> = | |
((...args: A) => any) extends ((h: any, ...t: infer T) => any) ? T : never | |
type HandleVoidAnyUnknown<Target, Fallback> = [void] extends [Target /* void/any/unknown */] | |
? Fallback | |
: Target | |
type StrictestFromTwo<L, R> = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isTestEnv = process.env.NODE_ENV === 'test'; | |
module.exports = { | |
presets: [ | |
[ | |
'@babel/preset-env', | |
{ | |
modules: isTestEnv | |
? 'commonjs' // transform imports for jest to work | |
: false, // do not transform imports to allow tree shaking by webpack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
mkdir src | |
cat << END > src/index.tsx | |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import App from "./App"; | |
const appRoot = document.querySelector("#root"); |
OlderNewer