Supabase - ~52K stars
- Designed explicitly as an open source firebase alternative
- Typescript based
- Docker support
Appwrite - ~32K stars
- Written in JavaScript and PHP
- Docker based
- Realtime support across all services
Baobab - JavaScript persistent and optionally immutable data tree with cursors
Mnemonist - Curated collection of data structures for the JavaScript language
TaffyDB - JavaScript library that provides powerful in-memory database capabilities to both browser and server applications
WatermelonDB - Next-gen database for powerful React and React Native apps that scales to 10,000s of records and remains fast
// Functor | |
export const map = f => s => x0 => { | |
const [v, x1] = s(x0); | |
return [f(v), x1]; | |
}; | |
// Applicative | |
export const pure = a => x => [a, x]; | |
export const ap = stf => stv => x0 => { | |
const [f, x1] = stf(x0); |
// @flow | |
import { createAction, createReducer, on, onType, Action } from "transdux"; | |
const inc: Action<void> = createAction(); | |
const add: Action<number> = createAction(); | |
const DEC = "DEC"; | |
const SUB = "SUB"; |
function State(fn) { | |
this._fn = fn; | |
} | |
State.state = fn => new State(fn); | |
State.of = val => State.state(state => [val, state]); | |
State.get = State.state(state => [state, state]); |
// FP Lenses | |
const lens = get => set => ({ get, set }); | |
const view = lens => obj => lens.get(obj); | |
const set = lens => val => obj => lens.set(val)(obj); | |
const over = lens => fn => obj => set(lens)(fn(view(lens)(obj)))(obj); | |
const lensProp = key => lens(prop(key))(assoc(key)); |
const Set = (lens, value, target) => lens.set(value, target) | |
const View = (lens, target) => lens.get(target) | |
const Over = (lens, func, target) => | |
Set(lens, func(View(lens, target), target), target) | |
const Compose = (...lenses) => { | |
lenses = lenses.reverse() | |
const itar = (i, target, value) => { | |
if (i === lenses.length) return value | |
return lenses[i].set(itar(i + 1, lenses[i].get(target), value), target) |
const B = f => g => x => f(g(x)); | |
const K = a => b => a; | |
const I = a => a; | |
const toPair = p => p(a => b => ({ first: a, second: b })); | |
const toNumber = n => n(x => x + 1)(0); | |
const toArray = l => l(x => xs => [x, ...xs])([]); | |
const toBoolean = b => b(true)(false); | |
const pair = a => b => f => f(a)(b); |
function getNoun(number, one, two, five) { | |
let n = Math.abs(number); | |
n %= 100; | |
if (n >= 5 && n <= 20) { | |
return five; | |
} | |
n %= 10; | |
if (n === 1) { | |
return one; | |
} |
const {tagged} = require('daggy'); | |
let Continuation = tagged('x'); | |
Continuation.prototype.of = Continuation.of = x => { | |
return new Continuation((resolve) => resolve(x)); | |
} | |
Continuation.prototype.chain = function(f) { | |
return this.x(f); |