This file contains hidden or 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 * as ts from 'typescript'; | |
| // import { Option as Option } from 'fp-ts/lib/Option'; | |
| const a = ts.createImportDeclaration( | |
| undefined, | |
| undefined, | |
| ts.createImportClause( | |
| undefined, | |
| ts.createNamedImports([ | |
| ts.createImportSpecifier( |
This file contains hidden or 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 { Either } from 'fp-ts/lib/Either'; | |
| import { openDB } from 'idb'; | |
| import { array, Type } from 'io-ts'; | |
| import { from, Observable, of, throwError } from 'rxjs'; | |
| import { mergeMap } from 'rxjs/operators'; | |
| export const objectFactory = ( | |
| name: string, | |
| keyPath: string, | |
| option: 'readonly' | 'readwrite' | 'versionchange' = 'readonly', |
This file contains hidden or 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 { DatumEither, failure, initial, toRefresh } from '@nll/datum/lib/DatumEither'; | |
| import { Task } from 'fp-ts/lib/Task'; | |
| import { Errors } from 'io-ts'; | |
| import { useEffect, useState } from 'preact/hooks'; | |
| export const useTaskDatumEither = <T>(task: Task<DatumEither<Errors, T>>) => { | |
| const [state, setState] = useState<DatumEither<Errors, T>>(initial); | |
| useEffect(() => { | |
| // Setup "cancellation closure" | |
| let linked = true; |
This file contains hidden or 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
| Print Listener: [1, 2] | |
| SHOULD ONLY HAPPEN ONCE: [1, 2] | |
| Print Listener: [1, 2, 1] | |
| Print Listener: [1, 2, 1, 2] | |
| Print Listener: [1, 2, 1, 2, 3] | |
| Print Listener: [1, 2, 1, 2, 3, 4] | |
| Final State: [1, 2, 1, 2, 3, 4] |
This file contains hidden or 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
| use nom::{ | |
| branch::alt, | |
| bytes::complete::{tag, take_until, take_while}, | |
| character::{complete::line_ending, is_alphabetic}, | |
| combinator::{map, opt, rest}, | |
| sequence::tuple, | |
| IResult, | |
| }; | |
| use std::str::from_utf8; |
This file contains hidden or 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 { Store as S, createStore, MetaReducer, RunOnce, RunEvery } from "./Store"; | |
| import { Reducer } from "./Reducers"; | |
| export interface StoreConfig<T> { | |
| readonly reducers: Reducer<T>[]; | |
| readonly metaReducers: MetaReducer<T>[]; | |
| readonly runOnces: RunOnce<T>[]; | |
| readonly runEverys: RunEvery<T>[]; | |
| } |
This file contains hidden or 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 * as C from "io-ts/es6/Codec"; | |
| import * as E from "fp-ts/es6/Either"; | |
| import { draw } from "io-ts/es6/Tree"; | |
| import { pipe } from "fp-ts/es6/pipeable"; | |
| import { actionCreatorFactory, AsyncActionCreators } from "@nll/dux/Actions"; | |
| import { asyncConcatMap } from "@nll/dux/Operators"; | |
| import { RunOnce, filterEvery, RunEvery, Store } from "@nll/dux/Store"; | |
| import { of, Observable, throwError, interval } from "rxjs"; | |
| import { mergeMap, map } from "rxjs/operators"; |
This file contains hidden or 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
| export * from "https://cdn.pika.dev/fp-ts@^2.6.1"; |
This file contains hidden or 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
| /** | |
| * @since 0.0.0 | |
| */ | |
| /** | |
| * @since 0.0.0 | |
| */ | |
| export interface SpringConfig { | |
| mass: number; | |
| tension: number; |
This file contains hidden or 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 { serve } from "https://deno.land/std/http/server.ts"; | |
| import { connect } from "https://deno.land/x/redis@v0.13.0/mod.ts"; | |
| import { use } from "https://deno.land/x/sedate@v0.0.2/deno_handler.ts"; | |
| import * as S from "https://deno.land/x/sedate@v0.0.2/sedate.ts"; | |
| import { pipe } from "https://deno.land/x/hkts@v0.0.15/fns.ts"; | |
| const nil = <A>(a: A): a is NonNullable<A> => a === undefined && a === null; | |
| const PORT = Deno.env.get("PORT"); | |
| const REDIS_URL = Deno.env.get("REDIS_URL"); |