diff --git a/src/behavior.ts b/src/behavior.ts
index 7ae9f97..80d04f7 100644
--- a/src/behavior.ts
+++ b/src/behavior.ts
@@ -5,9 +5,9 @@ import { Future, BehaviorFuture } from "./future";
import * as F from "./future";
import {
Stream,
- FlatFutureOrdered,
- FlatFutureLatest,
- FlatFuture
+ FlatFuturesOrdered,
+ FlatFuturesLatest,
+ FlatFutures
} from "./stream";
import { tick, getTime } from "./clock";
import { sample, Now } from "./now";
@@ -753,28 +753,30 @@ export function format(
return new FormatBehavior(strings, behaviors);
}
-export const flatFutureFrom = (
+export const flatFuturesFrom = (
stream: Stream>
-): Behavior> => fromFunction(() => new FlatFuture(stream));
+): Behavior> => fromFunction(() => new FlatFutures(stream));
-export function flatFuture(stream: Stream>): Now> {
- return sample(flatFutureFrom(stream));
+export function flatFutures(stream: Stream>): Now> {
+ return sample(flatFuturesFrom(stream));
}
-export const flatFutureOrderedFrom = (
+export const flatFuturesOrderedFrom = (
stream: Stream>
-): Behavior> => fromFunction(() => new FlatFutureOrdered(stream));
+): Behavior> => fromFunction(() => new FlatFuturesOrdered(stream));
-export function flatFutureOrdered(
+export function flatFuturesOrdered(
stream: Stream>
): Now> {
- return sample(flatFutureOrderedFrom(stream));
+ return sample(flatFuturesOrderedFrom(stream));
}
-export const flatFutureLatestFrom = (
+export const flatFuturesLatestFrom = (
stream: Stream>
-): Behavior> => fromFunction(() => new FlatFutureLatest(stream));
+): Behavior> => fromFunction(() => new FlatFuturesLatest(stream));
-export function flatFutureLatest(stream: Stream>): Now> {
- return sample(flatFutureLatestFrom(stream));
+export function flatFuturesLatest(
+ stream: Stream>
+): Now> {
+ return sample(flatFuturesLatestFrom(stream));
}
diff --git a/src/stream.ts b/src/stream.ts
index 528eac0..1f57b02 100644
--- a/src/stream.ts
+++ b/src/stream.ts
@@ -479,7 +479,7 @@ export function mapCbStream(
return new PerformCbStream(cb, stream);
}
-export class FlatFuture extends Stream {
+export class FlatFutures extends Stream {
constructor(stream: Stream>) {
super();
this.parents = cons(stream);
@@ -489,7 +489,7 @@ export class FlatFuture extends Stream {
}
}
-export class FlatFutureOrdered extends Stream {
+export class FlatFuturesOrdered extends Stream {
constructor(stream: Stream>) {
super();
this.parents = cons(stream);
@@ -518,7 +518,7 @@ export class FlatFutureOrdered extends Stream {
}
}
-export class FlatFutureLatest extends Stream
+export class FlatFuturesLatest extends Stream
implements SListener> {
constructor(stream: Stream>) {
super();
diff --git a/src/testing.ts b/src/testing.ts
index 6bc9692..70a71de 100644
--- a/src/testing.ts
+++ b/src/testing.ts
@@ -9,9 +9,9 @@ import {
CombineStream,
SnapshotStream,
isStream,
- FlatFuture,
- FlatFutureOrdered,
- FlatFutureLatest
+ FlatFutures,
+ FlatFuturesOrdered,
+ FlatFuturesLatest
} from "./stream";
import {
Behavior,
@@ -224,14 +224,14 @@ const flatFuture = (o: Occurrence>) => {
return time === "infinity" ? [] : [{ time: Math.max(o.time, time), value }];
};
-FlatFuture.prototype.model = function(this: FlatFuture) {
+FlatFutures.prototype.model = function(this: FlatFutures) {
return (this.parents.value as Stream>)
.model()
.flatMap(flatFuture)
.sort((o, p) => o.time - p.time); // FIXME: Should use stable sort here
};
-FlatFutureOrdered.prototype.model = function(this: FlatFutureOrdered) {
+FlatFuturesOrdered.prototype.model = function(this: FlatFuturesOrdered) {
return (this.parents.value as Stream>)
.model()
.flatMap(flatFuture)
@@ -241,7 +241,7 @@ FlatFutureOrdered.prototype.model = function(this: FlatFutureOrdered) {
}, []);
};
-FlatFutureLatest.prototype.model = function(this: FlatFutureLatest) {
+FlatFuturesLatest.prototype.model = function(this: FlatFuturesLatest) {
return (this.parents.value as Stream>)
.model()
.flatMap(flatFuture)
diff --git a/test/now.ts b/test/now.ts
index 7af78ce..fc0fc25 100644
--- a/test/now.ts
+++ b/test/now.ts
@@ -19,8 +19,7 @@ import {
SinkStream,
time,
toPromise,
- instant,
- flatFuture
+ instant
} from "../src";
import * as H from "../src";
import { createRef, mutateRef } from "./helpers";
@@ -196,7 +195,7 @@ describe("Now", () => {
});
const s = sinkStream();
const mappedS = s.map(impure);
- runNow(performStream(mappedS).flatMap(flatFuture)).subscribe((n) =>
+ runNow(performStream(mappedS).flatMap(H.flatFutures)).subscribe((n) =>
results.push(n)
);
s.push(1);
diff --git a/test/stream.ts b/test/stream.ts
index a2aea8a..281e4cd 100644
--- a/test/stream.ts
+++ b/test/stream.ts
@@ -6,7 +6,6 @@ import {
Behavior,
fromFunction,
sinkBehavior,
- sinkStream,
Future
} from "../src";
import * as H from "../src";
@@ -514,7 +513,7 @@ describe("stream", () => {
const fut2 = H.sinkFuture();
const fut3 = H.sinkFuture();
const s = H.sinkStream>();
- const s2 = H.runNow(H.flatFuture(s));
+ const s2 = H.runNow(H.flatFutures(s));
const sub = subscribeSpy(s2);
s.push(fut1);
s.push(fut2);
@@ -529,7 +528,7 @@ describe("stream", () => {
const fut2 = H.sinkFuture();
const fut3 = H.sinkFuture();
const s = H.sinkStream>();
- const s2 = H.runNow(H.flatFutureOrdered(s));
+ const s2 = H.runNow(H.flatFuturesOrdered(s));
const sub = subscribeSpy(s2);
s.push(fut1);
s.push(fut2);
@@ -544,7 +543,7 @@ describe("stream", () => {
const fut2 = H.sinkFuture();
const fut3 = H.sinkFuture();
const s = H.sinkStream>();
- const s2 = H.runNow(H.flatFutureLatest(s));
+ const s2 = H.runNow(H.flatFuturesLatest(s));
const sub = subscribeSpy(s2);
s.push(fut1);
s.push(fut2);
diff --git a/test/testing.ts b/test/testing.ts
index f238aec..14d83e4 100644
--- a/test/testing.ts
+++ b/test/testing.ts
@@ -208,7 +208,7 @@ describe("testing", () => {
assertStreamEqual(res, { 4: 1, 5: 1, 7: 2, 9: 3, 10: 1 });
});
});
- describe("flatFuture", () => {
+ describe("flatFutures", () => {
it("can be tested", () => {
const s = testStreamFromObject({
0: testFuture(1, "a"),
@@ -216,7 +216,7 @@ describe("testing", () => {
4: testFuture(2, "c"),
6: testFuture(7, "d")
});
- const res = testNow(H.flatFuture(s), []);
+ const res = testNow(H.flatFutures(s), []);
assert(H.isStream(res));
assertStreamEqual(
res,
@@ -224,7 +224,7 @@ describe("testing", () => {
);
});
});
- describe("flatFutureLatest", () => {
+ describe("flatFuturesLatest", () => {
it("can be tested", () => {
const s = testStreamFromObject({
0: testFuture(1, "a"),
@@ -234,7 +234,7 @@ describe("testing", () => {
8: testFuture(12, "e"), // should be dropped
10: testFuture(3, "f")
});
- const res = testNow(H.flatFutureLatest(s), []);
+ const res = testNow(H.flatFuturesLatest(s), []);
assert(H.isStream(res));
assertStreamEqual(
res,
@@ -242,7 +242,7 @@ describe("testing", () => {
);
});
});
- describe("flatFutureOrdered", () => {
+ describe("flatFuturesOrdered", () => {
it("can be tested", () => {
const s = testStreamFromObject({
0: testFuture(3, "a"),
@@ -251,7 +251,7 @@ describe("testing", () => {
3: testFuture(0, "d"),
4: testFuture(5, "e")
});
- const res = testNow(H.flatFutureOrdered(s), []);
+ const res = testNow(H.flatFuturesOrdered(s), []);
assert(H.isStream(res));
assertStreamEqual(
res,
@@ -379,7 +379,7 @@ describe("testing", () => {
);
const response: Stream = yield H.performStream(
request
- ).flatMap(H.flatFutureOrdered);
+ ).flatMap(H.flatFuturesOrdered);
return { res: response };
});
const click = testStreamFromObject({ 1: 1, 2: 2, 3: 3, 4: 4, 5: 5 });
@@ -410,7 +410,7 @@ describe("testing", () => {
})
);
const res = run(
- H.performStream(request).flatMap(H.flatFutureOrdered)
+ H.performStream(request).flatMap(H.flatFuturesOrdered)
);
return { res };
});