Comparing version 0.0.0-next.32 to 0.0.0-next.33
@@ -121,3 +121,3 @@ declare const PendingState: 0; | ||
}; | ||
export type WritableStream<T, GetT = T> = ReadableStream<T, GetT> & { | ||
export type SourceStream<T, GetT = T> = ReadableStream<T, GetT> & { | ||
set(value: T): void; | ||
@@ -127,4 +127,4 @@ update(visitor: (x: T) => T): void; | ||
interface StreamStatic { | ||
<T>(x: T): WritableStream<T>; | ||
<T>(): WritableStream<T, T | undefined>; | ||
<T>(x: T): SourceStream<T>; | ||
<T>(): SourceStream<T, T | undefined>; | ||
/** Creates a computed stream that reactively updates if any of its upstreams are updated. */ | ||
@@ -147,5 +147,5 @@ merge<S extends readonly any[]>(streams: { | ||
} | ||
export type Stream<T = any, GetT = any> = WritableStream<T, GetT> | ReadableStream<T>; | ||
export type Stream<T = any, GetT = any> = SourceStream<T, GetT> | ReadableStream<T>; | ||
declare function StreamStatic<T>(...args: [T] | []): InternalStream<T>; | ||
export { InternalStream, StreamStatic }; | ||
export declare const Stream: StreamStatic; |
@@ -983,3 +983,3 @@ const PendingState = 0 as const | ||
export type WritableStream<T, GetT=T> = ReadableStream<T, GetT> & { | ||
export type SourceStream<T, GetT=T> = ReadableStream<T, GetT> & { | ||
set(value: T): void | ||
@@ -990,4 +990,4 @@ update(visitor: (x: T) => T): void | ||
interface StreamStatic { | ||
<T>(x: T): WritableStream<T> | ||
<T>(): WritableStream<T, T | undefined> | ||
<T>(x: T): SourceStream<T> | ||
<T>(): SourceStream<T, T | undefined> | ||
/** Creates a computed stream that reactively updates if any of its upstreams are updated. */ | ||
@@ -1014,3 +1014,3 @@ | ||
export type Stream<T=any, GetT=any> = WritableStream<T, GetT> | ReadableStream<T> | ||
export type Stream<T=any, GetT=any> = SourceStream<T, GetT> | ReadableStream<T> | ||
@@ -1017,0 +1017,0 @@ // the following is just hacks to make the Stream both a function |
{ | ||
"name": "chifley", | ||
"version": "0.0.0-next.32", | ||
"version": "0.0.0-next.33", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "type": "module", |
@@ -182,3 +182,3 @@ # π chifley | ||
> π€ Note unlike `mithril-stream` `SKIP` only works as a return value within a stream transform. You can write `SKIP` to a writable stream but it will be treated like any other value. This removes two logical branches in the update path and speeds things up enough to warrant the sacrifice. | ||
> π€ Note unlike `mithril-stream` `SKIP` only works as a return value within a stream transform. You can write `SKIP` to a source stream but it will be treated like any other value. This removes two logical branches in the update path and speeds things up enough to warrant the sacrifice. | ||
@@ -538,9 +538,9 @@ ## Static methods and properties | ||
If you end a writable stream and change the value via `.set` or `.update` no exception will be thrown and the value will change. If you subscribe to an ended stream via an operator, no exceptions will be thrown but as the upstream dependency will never again emit, neither will the new dependent stream. | ||
If you end a source stream and change the value via `.set` or `.update` no exception will be thrown and the value will change. If you subscribe to an ended stream via an operator, no exceptions will be thrown but as the upstream dependency will never again emit, neither will the new dependent stream. | ||
When using `.merge`, if any dependency ends, the merged stream is ended. If another (unended) dependency emits, the merged stream won't emit. | ||
### `.abortSignal` | ||
### AbortSignal (`.signal`) | ||
Every chifley stream has an associated `.abortSignal`. AbortSignals are a fairly recent Javascript standard for supporting cancellation. You can use it natively with `fetch` and with `addEventListener`. | ||
Every chifley stream has an associated `.signal`. AbortSignals are a fairly recent Javascript standard for supporting cancellation. You can use it natively with `fetch` and with `addEventListener`. | ||
@@ -547,0 +547,0 @@ ```typescript |
Sorry, the diff of this file is not supported yet
116308