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 { StateSoruce, Reducer } from '@cycle/state' | |
| import { Stream } from 'xstream' | |
| import { DOMSource, VNode } from '@cycle/dom' | |
| import { HTTPSource, Request } from '@cycle/http' | |
| type Payload = object | |
| interface StoreState = { | |
| userProfile: object | |
| } |
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 { StateSoruce, Reducer } from '@cycle/state' | |
| import { Stream } from 'xstream' | |
| import { DOMSource, VNode } from '@cycle/dom' | |
| import { HTTPSource, Request } from '@cycle/http' | |
| type Payload = object | |
| interface StoreState = { | |
| userProfile: object | |
| } |
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
| # Cyclic | |
| foo --> bar --> baz --> bacon --> eggs | |
| | | | |
| <-- startWith <-- | |
| # Acyclic | |
| foo -----------------------> bar --> baz --> bacon --> eggs | |
| | | | |
| PLACEHOLDER --> startWith --> | | |
| | |
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
| interface Action<K extends keyof typeof ops> { | |
| action: K; | |
| data: (typeof ops[K]) extends (arg: infer T) => any ? T : undefined | |
| } | |
| const ops = { | |
| setFire: (data: { place: string }) => data, | |
| extinguish: (data: { extinguisherType: string }) => data | |
| } |
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
| portToBackground.onMessage.addListener(function (messages: BackgroundMessage) { | |
| // alert('LAUNCHER relaying message from BACKGROUND to PANEL: ' + JSON.stringify(message)) | |
| if (message.type === 'panelData' && typeof panelWindow['postMessage'] === 'function') { | |
| panelWindow['postMessage']({__fromCyclejsDevTool: true, data: message.data}, '*'); | |
| } else if (message.type === 'tabLoading' | |
| && message.tabId === chrome.devtools.inspectedWindow.tabId) { | |
| const settings = ` | |
| window.CyclejsDevToolSettings = ${JSON.stringify(sessionSettings)}; | |
| `; | |
| chrome.devtools.inspectedWindow.reload({ |
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 function mix< | |
| COMB extends { | |
| [CS in keyof ComponentSinks]?: (arg: { | |
| [K in keyof COMPONENTS]: Stream<any> | |
| }) => ComponentSinks[CS] | |
| }, | |
| COMPONENTS extends { | |
| [COMPNAME in keyof COMPONENTS]: { | |
| [SINKNAME in keyof ComponentSinks]?: (COMB[SINKNAME] extends (arg: infer STREAMS) => any ? ( | |
| COMPNAME extends keyof STREAMS ? STREAMS[COMPNAME] : ComponentSinks[SINKNAME] |
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 function mix< | |
| COMB extends { | |
| [CS in keyof ComponentSinks]?: (arg: { | |
| [K in keyof COMPONENTS]: Stream<any> | |
| }) => ComponentSinks[CS] | |
| }, | |
| COMPONENTS extends { | |
| [COMPNAME in keyof any]: { | |
| [SINKNAME in keyof ComponentSinks]?: (COMB[SINKNAME] extends (arg: infer STREAMS) => any ? ( | |
| STREAMS extends Hash<any> ? ( |
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 function mix< | |
| COMB extends { | |
| [CS in keyof ComponentSinks]?: (arg: { | |
| [K in keyof COMPONENTS]: Stream<any> | |
| }) => ComponentSinks[CS] | |
| }, | |
| COMPONENTS extends { | |
| [COMPNAME in string]: { | |
| [SINKNAME in keyof ComponentSinks]?: (COMB[SINKNAME] extends (arg: infer STREAMS) => any ? ( | |
| STREAMS extends Hash<any> ? ( |
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 Dict<T> = { [key: string]: T } | |
| interface component { | |
| bacon: Stream<string> | |
| lettuce?: Stream<number> | |
| } | |
| type baconArgs = { | |
| firstBastard: Stream<string>, | |
| secondBastard: Stream<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
| mix({ | |
| foo: { | |
| bacon: 'stuff' | |
| }, | |
| baz: { | |
| bacon: 123, | |
| lettuce: 'what' | |
| } | |
| }, { | |
| bacon: ({foo: string, baz: number}): void => {}, |