🎯
Focusing
Pinned Loading
-
Effector's store for AsyncStorage
Effector's store for AsyncStorage 1import { Store, createEffect, createStore, forward } from "effector";
2import AsyncStorage from "@react-native-async-storage/async-storage";
34type LocalStore = <T>(key: string) => (value: T) => Store<T>;
5 -
Ramda immutable queue
Ramda immutable queue 1const Queue = (list) => compose(
2set(lensProp('get'), always(list)),
3set(lensProp('peek'), always(head(list))),
4set(lensProp('enqueue'), (...elms) => Queue(concat(list, elms))),
5set(lensProp('dequeue'), (n = 1) => Queue(drop(n, list)))
-
ackermann function with ramda memoize
ackermann function with ramda memoize 1const ack = memoize((m, n) => cond([
2[() => equals(m, 0), () => inc(n)],
3[() => and(gt(m, 0), equals(n, 0)), () => ack(dec(m), 1)],
4[() => and(gt(m, 0), gt(n, 0)), () => ack(dec(m), ack(m, dec(n)))]
5])(m, n))
-
Functional fizzBuzz on ramda
Functional fizzBuzz on ramda 1const fizz = pipe(modulo(__, 3), equals(0))
2const buzz = pipe(modulo(__, 5), equals(0))
34const _cond = cond([[both(fizz, buzz), always("fizzbuzz")],
5[buzz, always("buzz")],
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.