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 { | |
div, span, p, input, ul, li, button, body | |
} | |
from '@cycle/dom' | |
import xs from 'xstream' | |
export function Todo(sources) { | |
const action$ = intent(sources.DOM); | |
const model$ = action$ | |
.fold((state, reducer) => reducer(state), { |
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 interface Source<T> { | |
subscribe(o: Observer<T>): any; | |
} | |
export class ArraySource<T> implements Source<T> { | |
constructor(private array: T[]) {} | |
public subscribe(observer: Observer<T>): any { | |
this.array.forEach(t => observer.next(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 xs, { Stream } from 'xstream'; | |
import { VNode, DOMSource } from '@cycle/dom'; | |
import { StateSource } from 'cycle-onionify'; | |
import { Sources, Sinks } from './interfaces'; | |
import { Counter, AppState as ChildState } from './counter' | |
export type AppSources = Sources & { onion : StateSource<AppState> }; | |
export type AppSinks = Sinks & { onion : Stream<Reducer> }; | |
export type Reducer = (prev : AppState) => AppState; |
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
{-# LANGUAGE CPP #-} | |
{-# LANGUAGE OverloadedLabels #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
module Main where | |
-- #define SUPERRECORD | |
#define MEGARECORD |
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
type SimpleMerge<Global, Local> = { global: Global, local: Local }; | |
interface Merger<Global, Local, T> { | |
merge(g: Global, l: Local): T; | |
extract(t: T): SimpleMerge<Partial<Global>, Partial<Local>>; | |
} | |
function withLocalState<Global, Local, T = SimpleMerge<Global, Local>>(component: Component<T>, merger?: Merger<Global, Local, T>, stateChannel = 'state', localChannel = '_localState'): Component<Global> { | |
const defaultMerger: Merger<Global, Local, SimpleMerge<Global, Local>> = { | |
merge: (global, local) => ({ global, local }), | |
extract: identity |
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
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: haproxy | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: ingresses-controller | |
namespace: haproxy |