diff --git a/src/main/scala-3/com/raquo/airstream/split/SplitMatchOneTypeObservable.scala b/src/main/scala-3/com/raquo/airstream/split/SplitMatchOneTypeObservable.scala index fd94831..49b9f1f 100644 --- a/src/main/scala-3/com/raquo/airstream/split/SplitMatchOneTypeObservable.scala +++ b/src/main/scala-3/com/raquo/airstream/split/SplitMatchOneTypeObservable.scala @@ -10,7 +10,7 @@ import com.raquo.airstream.split.MacrosUtilities.{CaseAny, HandlerAny, MatchType * * ```scala * fooSignal.splitMatchOne - * .splitType[Baz] { (baz, bazSignal) => renderBazNode(baz, bazSignal) } + * .handleType[Baz] { (baz, bazSignal) => renderBazNode(baz, bazSignal) } * ``` * * will be expanded sematically into: diff --git a/src/main/scala/com/raquo/airstream/common/SingleParentSignal.scala b/src/main/scala/com/raquo/airstream/common/SingleParentSignal.scala index 506ca65..7917988 100644 --- a/src/main/scala/com/raquo/airstream/common/SingleParentSignal.scala +++ b/src/main/scala/com/raquo/airstream/common/SingleParentSignal.scala @@ -20,8 +20,8 @@ trait SingleParentSignal[I, O] extends WritableSignal[O] with InternalTryObserve protected[this] var _parentLastUpdateId: Int = -1 /** Note: this is overriden in: - * - [[com.raquo.airstream.misc.SignalFromStream]] because parent can be stream, and it has cacheInitialValue logic - * - [[com.raquo.airstream.split.SplitChildSignal]] because its parent is a special timing stream, not the real parent + * - [[com.raquo.airstream.misc.SignalFromStream]] because parent can be stream, and it has cacheInitialValue logic + * - [[com.raquo.airstream.split.SplitChildSignal]] because its parent is a special timing stream, not the real parent */ override protected def onWillStart(): Unit = { // dom.console.log(s"${this} > onWillStart (SPS)") diff --git a/src/main/scala/com/raquo/airstream/core/EventStream.scala b/src/main/scala/com/raquo/airstream/core/EventStream.scala index 4592998..f479ec1 100644 --- a/src/main/scala/com/raquo/airstream/core/EventStream.scala +++ b/src/main/scala/com/raquo/airstream/core/EventStream.scala @@ -391,8 +391,8 @@ object EventStream { } /** Create a stream from a [[java.util.concurrent.Flow.Publisher]] - * - Use this to bring in events from other streaming libraries - * that can provide a `Flow.Publisher`, such as FS2 an Monix. + * - Use this to bring in events from other streaming libraries + * that can provide a `Flow.Publisher`, such as FS2 an Monix. */ def fromPublisher[A](publisher: Flow.Publisher[A], emitOnce: Boolean = false): EventStream[A] = { FlowPublisherStream(publisher, emitOnce) diff --git a/src/main/scala/com/raquo/airstream/core/Named.scala b/src/main/scala/com/raquo/airstream/core/Named.scala index 769088f..fcafacc 100644 --- a/src/main/scala/com/raquo/airstream/core/Named.scala +++ b/src/main/scala/com/raquo/airstream/core/Named.scala @@ -24,10 +24,10 @@ trait Named { final def displayName: String = maybeDisplayName.getOrElse(defaultDisplayName) /** Set the display name for this instance (observable or observer). - * - This method modifies the instance and returns `this`. It does not create a new instance. - * - New name you set will override the previous name, if any. - * This might change in the future. For the sake of sanity, don't call this more than once for the same instance. - * - If display name is set, toString will output it instead of the standard type@hashcode string + * - This method modifies the instance and returns `this`. It does not create a new instance. + * - New name you set will override the previous name, if any. + * This might change in the future. For the sake of sanity, don't call this more than once for the same instance. + * - If display name is set, toString will output it instead of the standard type@hashcode string */ def setDisplayName(name: String): this.type = { maybeDisplayName = name // @TODO[Warn] Maybe we should emit a warning if name was already set diff --git a/src/main/scala/com/raquo/airstream/core/Signal.scala b/src/main/scala/com/raquo/airstream/core/Signal.scala index 78d4e4d..9659578 100644 --- a/src/main/scala/com/raquo/airstream/core/Signal.scala +++ b/src/main/scala/com/raquo/airstream/core/Signal.scala @@ -239,13 +239,13 @@ object Signal { // TODO[API] do we need this? /** A stream from js.Promise that kind-of sort-of behaves like a signal: - * - It only every emits once, when the promise resolves. - * - If you miss that event because this stream got stopped before the - * promise resolved, you will receive that event when you start this - * stream again - * - However, if this stream was not stopped, new subscribers will not - * receive the event. If you need such behaviour, use a proper signal - * instead. + * - It only every emits once, when the promise resolves. + * - If you miss that event because this stream got stopped before the + * promise resolved, you will receive that event when you start this + * stream again + * - However, if this stream was not stopped, new subscribers will not + * receive the event. If you need such behaviour, use a proper signal + * instead. */ // def fromJsPromiseToStream[A](promise: js.Promise[A]): EventStream[A] = { // new JsPromiseSignal(promise).changes.map(_.get) diff --git a/src/main/scala/com/raquo/airstream/core/Transaction.scala b/src/main/scala/com/raquo/airstream/core/Transaction.scala index b9bee39..0b04fda 100644 --- a/src/main/scala/com/raquo/airstream/core/Transaction.scala +++ b/src/main/scala/com/raquo/airstream/core/Transaction.scala @@ -12,12 +12,12 @@ import scala.scalajs.js /** Transaction is a moment in time during which Airstream guarantees no FRP glitches. * * Some observables need to emit their events in new transactions. Roughly speaking: - * - All async observables (e.g. delay(100)) - * - All observables that can create loops in the observable graph (e.g. flatMapSwitch) - * - All observables that get their events from outside of Airstream (e.g. custom sources) + * - All async observables (e.g. delay(100)) + * - All observables that can create loops in the observable graph (e.g. flatMapSwitch) + * - All observables that get their events from outside of Airstream (e.g. custom sources) * * An observable can only emit once in a given transaction. - * - See [[MergeStream]] or [[CustomSource]] for examples of handling that. + * - See [[MergeStream]] or [[CustomSource]] for examples of handling that. * * See the docs for more details. * @@ -110,10 +110,10 @@ object Transaction { * * It is very hard to deliberately write valid code that would hit this * limit. If you are hitting this limit, most likely: - * - There is an (unterminated) infinite loop in your observable graph, - * e.g. two Var-s updating each other recursively, or - * - You are doing something that looks a lot like that for the first - * `maxDepth` transactions. + * - There is an (unterminated) infinite loop in your observable graph, + * e.g. two Var-s updating each other recursively, or + * - You are doing something that looks a lot like that for the first + * `maxDepth` transactions. * * You probably need to adjust your code instead of raising this limit, * but if you have a valid need for raising it, please let me know. diff --git a/src/main/scala/com/raquo/airstream/custom/CustomSource.scala b/src/main/scala/com/raquo/airstream/custom/CustomSource.scala index e634db2..a457bd5 100644 --- a/src/main/scala/com/raquo/airstream/custom/CustomSource.scala +++ b/src/main/scala/com/raquo/airstream/custom/CustomSource.scala @@ -10,8 +10,8 @@ import scala.util.Try /** Base functionality for a custom observable based on start and stop callbacks. * * See: - * - [[com.raquo.airstream.custom.CustomStreamSource]] - * - [[com.raquo.airstream.custom.CustomSignalSource]] + * - [[com.raquo.airstream.custom.CustomStreamSource]] + * - [[com.raquo.airstream.custom.CustomSignalSource]] */ trait CustomSource[A] extends WritableObservable[A] { @@ -52,10 +52,10 @@ object CustomSource { ) { self => /** Create a version of a config that only runs start / stop if the predicate passes. - * - `start` will be run when the CustomSource is about to start - * if `passes` returns true at that time - * - `stop` will be run when the CustomSource is about to stop - * if your `start` code ran the last time CustomSource started + * - `start` will be run when the CustomSource is about to start + * if `passes` returns true at that time + * - `stop` will be run when the CustomSource is about to stop + * if your `start` code ran the last time CustomSource started */ def when(passes: () => Boolean): Config = { var passed = false diff --git a/src/main/scala/com/raquo/airstream/flatten/ConcurrentStream.scala b/src/main/scala/com/raquo/airstream/flatten/ConcurrentStream.scala index ba4259c..9466def 100644 --- a/src/main/scala/com/raquo/airstream/flatten/ConcurrentStream.scala +++ b/src/main/scala/com/raquo/airstream/flatten/ConcurrentStream.scala @@ -7,11 +7,11 @@ import com.raquo.ew.JsArray import scala.util.{Failure, Success} /** This is essentially a dynamic version of `EventStream.merge`. - * - The resulting stream re-emits all the events emitted by all of the streams - * previously emitted by the input observable. - * - If you restart the resulting stream, it will remember and resubscribe to all of the - * streams it previously listened to. - * - If the input observable emits the same stream more than once, that stream will only be added once. + * - The resulting stream re-emits all the events emitted by all of the streams + * previously emitted by the input observable. + * - If you restart the resulting stream, it will remember and resubscribe to all of the + * streams it previously listened to. + * - If the input observable emits the same stream more than once, that stream will only be added once. */ class ConcurrentStream[A]( parent: Observable[EventStream[A]] diff --git a/src/main/scala/com/raquo/airstream/misc/MapSignal.scala b/src/main/scala/com/raquo/airstream/misc/MapSignal.scala index 7334a2f..63cc0f0 100644 --- a/src/main/scala/com/raquo/airstream/misc/MapSignal.scala +++ b/src/main/scala/com/raquo/airstream/misc/MapSignal.scala @@ -11,9 +11,9 @@ import scala.util.{Failure, Success, Try} /** This signal emits an error if the parent observable emits an error or if `project` throws * * If `recover` is defined and needs to be called, it can do the following: - * - Return Some(value) to make this signal emit value - * - Return None to make this signal ignore (swallow) this error - * - Not handle the error (meaning .isDefinedAt(error) must be false) to emit the original error + * - Return Some(value) to make this signal emit value + * - Return None to make this signal ignore (swallow) this error + * - Not handle the error (meaning .isDefinedAt(error) must be false) to emit the original error * * @param project Note: guarded against exceptions * @param recover Note: guarded against exceptions diff --git a/src/main/scala/com/raquo/airstream/misc/MapStream.scala b/src/main/scala/com/raquo/airstream/misc/MapStream.scala index cb2f9be..4d01f15 100644 --- a/src/main/scala/com/raquo/airstream/misc/MapStream.scala +++ b/src/main/scala/com/raquo/airstream/misc/MapStream.scala @@ -11,9 +11,9 @@ import scala.util.Try * This stream emits an error if the parent observable emits an error or if `project` throws * * If `recover` is defined and needs to be called, it can do the following: - * - Return Some(value) to make this stream emit value - * - Return None to make this stream ignore (swallow) this error - * - Not handle the error (meaning .isDefinedAt(error) must be false) to emit the original error + * - Return Some(value) to make this stream emit value + * - Return None to make this stream ignore (swallow) this error + * - Not handle the error (meaning .isDefinedAt(error) must be false) to emit the original error * * If `recover` throws an exception, it will be wrapped in `ErrorHandlingError` and propagated. * diff --git a/src/main/scala/com/raquo/airstream/ownership/Owner.scala b/src/main/scala/com/raquo/airstream/ownership/Owner.scala index 0b01bc5..289075f 100644 --- a/src/main/scala/com/raquo/airstream/ownership/Owner.scala +++ b/src/main/scala/com/raquo/airstream/ownership/Owner.scala @@ -5,14 +5,14 @@ import com.raquo.ew.JsArray import scala.annotation.unused /** Owner decides when to kill its subscriptions. - * - Ownership is defined at creation of the [[Subscription]] - * - Ownership is non-transferable - * - There is no way to unkill a Subscription - * - In other words: Owner can only own a Subscription once, - * and a Subscription can only ever be owned by its initial owner - * - Owner can still be used after calling killPossessions, but the canonical - * use case is for the Owner to kill its possessions when the owner itself - * is discarded (e.g. a UI component is unmounted). + * - Ownership is defined at creation of the [[Subscription]] + * - Ownership is non-transferable + * - There is no way to unkill a Subscription + * - In other words: Owner can only own a Subscription once, + * and a Subscription can only ever be owned by its initial owner + * - Owner can still be used after calling killPossessions, but the canonical + * use case is for the Owner to kill its possessions when the owner itself + * is discarded (e.g. a UI component is unmounted). * * If you need something more flexible, use [[DynamicOwner]], * or build your own custom logic on top of this in a similar manner. diff --git a/src/main/scala/com/raquo/airstream/state/Var.scala b/src/main/scala/com/raquo/airstream/state/Var.scala index 147e954..985ee68 100644 --- a/src/main/scala/com/raquo/airstream/state/Var.scala +++ b/src/main/scala/com/raquo/airstream/state/Var.scala @@ -316,9 +316,9 @@ object Var { * Example usage: Var.update(var1 -> value1 => value1 + 1, var2 -> value2 => value2 * 2) * * Mod functions should be PURE. - * - If a mod throws, the var will be set to a failed state. - * - If you try to update a failed Var, `Var.update` will post an error to unhandled errors, - * and none of the Vars will update. + * - If a mod throws, the var will be set to a failed state. + * - If you try to update a failed Var, `Var.update` will post an error to unhandled errors, + * and none of the Vars will update. * * Reports an Airstream unhandled error: * 1) if currentValue of any of the vars is a Failure. diff --git a/src/main/scala/com/raquo/airstream/timing/SyncDelayStream.scala b/src/main/scala/com/raquo/airstream/timing/SyncDelayStream.scala index d9d4b00..2ada4dd 100644 --- a/src/main/scala/com/raquo/airstream/timing/SyncDelayStream.scala +++ b/src/main/scala/com/raquo/airstream/timing/SyncDelayStream.scala @@ -8,8 +8,8 @@ import scala.util.Try /** Note: This is generally supposed to be used only with streams as inputs. * Make sure you know what you're doing if using signals. - * - if `parent` is a Signal, this stream mirrors `parent.changes`, not `parent`. - * - if `after` is a Signal, this stream ignores its initial value + * - if `parent` is a Signal, this stream mirrors `parent.changes`, not `parent`. + * - if `after` is a Signal, this stream ignores its initial value */ class SyncDelayStream[A]( override protected[this] val parent: Observable[A], diff --git a/src/main/scala/com/raquo/airstream/timing/ThrottleStream.scala b/src/main/scala/com/raquo/airstream/timing/ThrottleStream.scala index eda90b5..66b0020 100644 --- a/src/main/scala/com/raquo/airstream/timing/ThrottleStream.scala +++ b/src/main/scala/com/raquo/airstream/timing/ThrottleStream.scala @@ -8,13 +8,13 @@ import scala.scalajs.js.timers.SetTimeoutHandle import scala.util.Try /** [[ThrottleStream]] emits at most one event per `intervalMs`. - * - All events are emitted in a new transaction, after an async delay, even if the delay is zero ms - * - Any incoming event is scheduled to be emitted as soon as possible, but no sooner than `intervalMs` - * after the last event that was actually emitted by the throttled stream - * - When an event is scheduled to be emitted, any event that was previously scheduled is cancelled - * (that's the nature of throttling, you only get at most one event within `intervalMs`) - * - Errors are propagated in the same manner - * - Stopping the stream cancels scheduled events and makes it forget everything that happened before. + * - All events are emitted in a new transaction, after an async delay, even if the delay is zero ms + * - Any incoming event is scheduled to be emitted as soon as possible, but no sooner than `intervalMs` + * after the last event that was actually emitted by the throttled stream + * - When an event is scheduled to be emitted, any event that was previously scheduled is cancelled + * (that's the nature of throttling, you only get at most one event within `intervalMs`) + * - Errors are propagated in the same manner + * - Stopping the stream cancels scheduled events and makes it forget everything that happened before. * * See also See also [[DebounceStream]] */ diff --git a/src/main/scala/com/raquo/airstream/web/WebStorageVar.scala b/src/main/scala/com/raquo/airstream/web/WebStorageVar.scala index 2f57fc2..478a09f 100644 --- a/src/main/scala/com/raquo/airstream/web/WebStorageVar.scala +++ b/src/main/scala/com/raquo/airstream/web/WebStorageVar.scala @@ -27,14 +27,14 @@ import scala.util.{Success, Try} * and SessionStorage) in browser settings. In those cases, the * Var will still work as a normal Airstream Var, but its value * will not be persisted in the browser. - * - To detect this condition, see helpers on the companion object. + * - To detect this condition, see helpers on the companion object. * * See https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage * See https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage * * For constructor params doc, see scaladoc for: - * - [[WebStorageVar.localStorage]] - * - [[WebStorageVar.sessionStorage]] + * - [[WebStorageVar.localStorage]] + * - [[WebStorageVar.sessionStorage]] */ class WebStorageVar[A] private[web] ( private[web] val maybeStorage: () => Option[dom.Storage], @@ -224,8 +224,8 @@ object WebStorageVar { /** Users may disable site data (incl. LocalStorage) in browser settings. * This checks whether you can actually write to LocalStorage. - * - Note: If this returns false, Airstream's local storage Var would keep - * working as a regular Var, but without persistence to localStorage. + * - Note: If this returns false, Airstream's local storage Var would keep + * working as a regular Var, but without persistence to localStorage. * * See [[localStorageError]] */ @@ -233,15 +233,15 @@ object WebStorageVar { /** Users may disable site data (incl. SessionStorage) in browser settings. * This checks whether you can actually write to SessionStorage. - * - Note: If this returns false, Airstream's session storage Var would keep - * working as a regular Var, but without persistence to sessionStorage. + * - Note: If this returns false, Airstream's session storage Var would keep + * working as a regular Var, but without persistence to sessionStorage. * * See [[sessionStorageError]] */ def isSessionStorageAvailable(): Boolean = sessionStorageError().isEmpty /** If this method returns an error, you won't be able to save data to LocalStorage. - * - Note: the Airstream LocalStorage Var will continue working as an ephemeral Var. + * - Note: the Airstream LocalStorage Var will continue working as an ephemeral Var. * * See [[isLocalStorageAvailable]] */ @@ -250,7 +250,7 @@ object WebStorageVar { } /** If this method returns an error, you won't be able to save data to SessionStorage, - * - Note: the Airstream SessionStorage Var will continue working as an ephemeral Var. + * - Note: the Airstream SessionStorage Var will continue working as an ephemeral Var. * * See [[isSessionStorageAvailable]] */