Skip to content

Instantly share code, notes, and snippets.

View Dr-Nikson's full-sized avatar
🎯
Focusing

Nick Gushchin Dr-Nikson

🎯
Focusing
  • Italy
View GitHub Profile
@zerobias
zerobias / .flowconfig
Last active January 25, 2018 09:48
More effective flow typings
[options]
module.name_mapper='^most-subject$' -> '<PROJECT_ROOT>/most-subject'
@bvaughn
bvaughn / eager-prefetching-async-data-example.js
Last active November 28, 2024 00:44
Advanced example for eagerly prefetching async data in a React component.
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};
@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
// @flow
interface Command<A> {
run(): A;
}
class Call<A> implements Command<A> {
value: () => A;
constructor<X>(f: X => A, x: X) {