Mirror: 🎩 A tiny but capable push & pull stream library for TypeScript and Flow

upgrade to bucklescript@8 (#88)

Austaras 7da41b3c bfe1e855

+1 -1
package.json
···
"@types/jest": "^25.2.3",
"@types/zen-observable": "^0.8.0",
"babel-plugin-closure-elimination": "^1.3.1",
-
"bs-platform": "^7.3.2",
"callbag-from-iter": "^1.2.0",
"callbag-iterate": "^1.0.0",
"callbag-take": "^1.5.0",
···
"@types/jest": "^25.2.3",
"@types/zen-observable": "^0.8.0",
"babel-plugin-closure-elimination": "^1.3.1",
+
"bs-platform": "^8.0.2",
"callbag-from-iter": "^1.2.0",
"callbag-iterate": "^1.0.0",
"callbag-take": "^1.5.0",
+3 -3
src/Wonka_sources.test.ts
···
});
describe('fromList', () => {
-
passesTrampoline(sources.fromList([1, [2]] as any));
-
passesColdPull(sources.fromList([0] as any));
-
passesActiveClose(sources.fromList([0] as any));
});
describe('fromValue', () => {
···
});
describe('fromList', () => {
+
passesTrampoline(sources.fromList({hd: 1, tl: { hd: 2, tl: 0 } } as any));
+
passesColdPull(sources.fromList({ hd: 0, tl: 0 } as any));
+
passesActiveClose(sources.fromList({ hd: 1, tl: 0 } as any));
});
describe('fromValue', () => {
+10 -11
src/helpers/Wonka_deriving.ts
···
-
import { __ as block } from 'bs-platform/lib/es6/block';
import { talkbackPlaceholder } from './Wonka_helpers.bs';
import {
···
type talkbackCb = (tb: talkbackT) => void;
-
export const pull = (0 as any as talkbackT);
-
export const close = (1 as any as talkbackT);
-
export const start = <a>(tb: talkbackCb): signalT<a> => block(0, [tb]) as any;
-
export const push = <a>(x: a): signalT<a> => block(1, [x]) as any;
-
export const end = <a>(): signalT<a> => 0 as any;
export const isStart = <a>(s: signalT<a>) =>
-
typeof s !== 'number' && (s as any).tag === 0;
export const isPush = <a>(s: signalT<a>) =>
-
typeof s !== 'number' && (s as any).tag === 1;
export const isEnd = <a>(s: signalT<a>) =>
-
typeof s === 'number' && (s as any) === 0;
export const unboxPush = <a>(s: signalT<a>): a | null =>
-
isPush(s) ? (s as any)[0] : null;
export const unboxStart = <a>(s: signalT<a>): talkbackCb =>
-
isStart(s) ? (s as any)[0] : (talkbackPlaceholder as any);
···
import { talkbackPlaceholder } from './Wonka_helpers.bs';
import {
···
type talkbackCb = (tb: talkbackT) => void;
+
export const pull: talkbackT = 0;
+
export const close: talkbackT = 1;
+
export const start = <a>(tb: talkbackCb): signalT<a> => ({TAG: 0, "_0": tb});
+
export const push = <a>(x: a): signalT<a> => ({TAG: 1, "_0": x});
+
export const end = <a>(): signalT<a> => 0;
export const isStart = <a>(s: signalT<a>) =>
+
typeof s !== 'number' && s.TAG === 0;
export const isPush = <a>(s: signalT<a>) =>
+
typeof s !== 'number' && s.TAG === 1;
export const isEnd = <a>(s: signalT<a>) =>
+
typeof s === 'number' && s === 0;
export const unboxPush = <a>(s: signalT<a>): a | null =>
+
isPush(s) ? s["_0"] : null;
export const unboxStart = <a>(s: signalT<a>): talkbackCb =>
+
isStart(s) ? s["_0"] : (talkbackPlaceholder as any);
+2 -2
src/shims/Js.shim.ts
···
export type talkbackT = 0 | 1;
export type signalT<a> =
-
| ({ tag: 0 } & [(talkback: talkbackT) => void])
-
| ({ tag: 1 } & [a])
| 0;
export interface observableSubscriptionT {
···
export type talkbackT = 0 | 1;
export type signalT<a> =
+
| ({ TAG: 0, _0: (talkback: talkbackT) => void })
+
| ({ TAG: 1, _0: a })
| 0;
export interface observableSubscriptionT {
+4 -4
yarn.lock
···
dependencies:
fast-json-stable-stringify "2.x"
-
bs-platform@^7.3.2:
-
version "7.3.2"
-
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-7.3.2.tgz#301f5c9b4e8cf5713cb60ca22e145e56e793affe"
-
integrity sha512-seJL5g4anK9la4erv+B2o2sMHQCxDF6OCRl9en3hbaUos/S3JsusQ0sPp4ORsbx5eXfHLYBwPljwKXlgpXtsgQ==
bser@2.1.1:
version "2.1.1"
···
dependencies:
fast-json-stable-stringify "2.x"
+
bs-platform@^8.0.2:
+
version "8.0.2"
+
resolved "https://registry.yarnpkg.com/bs-platform/-/bs-platform-8.0.2.tgz#8caf775c6c6fcde57ebb12f9efacd346951aeb45"
+
integrity sha512-2vHnyxCd4m5QYG/hxUGsevOqEkpqL+chmjV7I3yz9NT2lEtF6RafpUj30myQqdpDcIIhLja3PCkNq+ZVNSsXQA==
bser@2.1.1:
version "2.1.1"