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 { fold, pending, RemoteData } from '@devexperts/remote-data-ts'; | |
import { constNull } from 'fp-ts/lib/function'; | |
import { createElement, memo, useEffect, useMemo, useState } from 'react'; | |
import { pipe } from 'fp-ts/lib/pipeable'; | |
import { LiveData } from '@devexperts/rx-utils/dist/live-data.utils'; | |
import { newSink, Sink } from '@devexperts/rx-utils/dist/sink2.utils'; | |
import { Context, context } from '@devexperts/rx-utils/dist/context2.utils'; | |
import { observable } from '@devexperts/rx-utils/dist/observable.utils'; | |
import { distinctUntilChanged, share, switchMap } from 'rxjs/operators'; | |
import { render } from 'react-dom'; |
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 { ResponseValidationError, WebSocketClient, WebSocketClient1, WebSocketClient2 } from '../client/client'; | |
import { | |
LightMeasuredPublishMessage, | |
LightMeasuredPublishMessageIO, | |
} from '../components/messages/LightMeasuredPublishMessage'; | |
import { Id, IdIO } from '../components/schemas/Id'; | |
import { Lumens, LumensIO } from '../components/schemas/Lumens'; | |
import { SentAt, SentAtIO } from '../components/schemas/SentAt'; | |
import { mapLeft, fold } from 'fp-ts/lib/Either'; | |
import { HKT, Kind, Kind2, URIS, URIS2 } from 'fp-ts/lib/HKT'; |
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 { OutputOf, string, type, Type, TypeOf, Validation } from 'io-ts'; | |
import React, { FC, useState } from 'react'; | |
import { either, left, map, right } from 'fp-ts/lib/Either'; | |
import { sequenceS } from 'fp-ts/lib/Apply'; | |
import { NumberFromString } from 'io-ts-types/lib/NumberFromString'; | |
import { pipe } from 'fp-ts/lib/pipeable'; | |
const formDataCodec = type({ | |
age: NumberFromString, | |
password: string, |
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
/** | |
* @see http://www.typescriptlang.org/play/?target=6#code/JYOwLgpgTgZghgYwgAgKoCUCSAmAEgaQBUAeVAGmQBkKBBAPmQG8AoAX2ebAE8AHFDTAGVkAXmQBrCFwD2MNFjxFicEFwoq1yDXQ7c+yQrwiksyCAA9IIACYBneUIrkqtBmIGKSz6snoBtAQBdDjgAI1swKEQwZAQAGzhbewISADEzSwgbewFBJwofeiZmZFLkAH0BAEIALmRUgG4SssratCayiso2yg6WmjaaJvZmAHoAKnGS8eQAAVsIFAALMDAeWxrR0YBzYDAlgFdQgDoEaQBbUYBZYAQoaVtZMFHDPkE74B5n4CSDiFtRgBGAAsAA5sABOADEP1sfzO53OWTAAFoAKwABmBWOwaOBADZpqNOEZkAA5aSYEAwaDEQhuZB+QiBJkZKx2LSqZAAfmQGOQdRAEAAbtBglsOKBILBEChUgcQAgwNIoMR0hZ2TksHk0AVXGyshyUmr8i5fAwWJ0oBA4NZpCA4lxkOc4Dw6sQAEJ0AAUMDq3rgdRoAEpRAwPaGRAxXsZUqafF62BwYAqlcB7c7XWqDdkHDrvLQKF7fYH6qnlaq47qzfQKH7kAG6hSqTTVfRI+Hg3UYybqwmLc1StawAcoCBkPBji6eL7g8NJeBoPAkL4eDxHdmNYatY4+-qt7n5YqK72C+bSpaytbbfbHVo3chPT74KFu0ZT3qG6WQ2HkF6OwY75VmeiYjCmx7puOWbqpkua5PGhZ-s+YRBmuG7AZ+ja+ABXp1t+aFcB+NZ0F2gF8ER-bFFaEAjmOE5wMcrolqEWj2BowZJsw4FphmCwAI5-IqEBpDmHLwXuBiifYNBQFEhE0ARFHqKodCqd6xwaXAUDbBskkAGRMHyqHroRGFmtoyCsKRPZmT4jCMvgyCgBIUiyAYgR1Eyfj4IEgRSYyNkIU51LQOafm8jQArIEKopQJZA6dGcIARBOKViFpOl+BiwSJfaKXSPs |
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 { Lens } from 'monocle-ts'; | |
import { findFirst } from 'fp-ts/lib/Array'; | |
import { Predicate } from 'fp-ts/lib/function'; | |
import { none, option, Option, some } from 'fp-ts/lib/Option'; | |
import { Monad, Monad1, Monad2, Monad2C, Monad3, Monad3C } from 'fp-ts/lib/Monad'; | |
import { HKT, Type, Type2, Type3, URIS, URIS2, URIS3 } from 'fp-ts/lib/HKT'; | |
type Column = { | |
name: string; | |
filtering: Option<'ASC' | 'DESC'>; |
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 { right, either, left } from 'fp-ts/lib/Either' | |
import { HKTAs, HKT2As, HKT2, HKTS, HKT, HKT2S } from 'fp-ts/lib/HKT' | |
import { Monad } from 'fp-ts/lib/Monad' | |
import { option, some } from 'fp-ts/lib/Option' | |
function Do<M extends HKT2S>(m: Monad<M>): <L, A>(generator: () => Iterator<HKT2<M, L, A>>) => HKT2As<M, L, A> | |
function Do<M extends HKTS>(m: Monad<M>): <A>(generator: () => Iterator<HKT<M, A>>) => HKTAs<M, A> | |
function Do<M extends HKTS>(m: Monad<M>): <A>(generator: () => Iterator<HKT<M, A>>) => HKT<M, A> { | |
return <A>(generator: () => Iterator<HKT<M, A>>): HKT<M, A> => { | |
const iterator = generator() |
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, left, right, either } from './Either' | |
import { constant } from './function' | |
import { Validation, failure, success, validation } from './Validation' | |
import { array, traverse } from './Array' | |
type TValidation<A> = Validation<string[], A> | |
const fail = <L, A>(error: L): Validation<L[], A> => failure(array)([error]) | |
const belowZero = (n: number): TValidation<number> => (n < 0 ? success(n) : fail('GTE zero')) | |
const aboveFive = (n: number): TValidation<number> => (n > 5 ? success(n) : fail('LTE five')) |
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
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-toolbar/core-toolbar.html"> | |
<link rel="import" href="../core-header-panel/core-header-panel.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { |