jshelpers
package jshelpers
- Alphabetic
- Public
- Protected
Type Members
- trait AllInstances extends JSPromiseInstances
- trait AllSyntax extends JsDynamicSyntax with JsObjectSyntax with JsAnySyntax with OrNullSyntax with ScalaMappedSyntax with OptionSyntax with JsUndefOrSyntax with MiscOrSyntax with JSPromiseSyntax with OrSyntax with JSArraySyntax
- trait AnyOps[T] extends AnyRef
- trait Instances extends AnyRef
Instances with everything but all so it can be subclassed elsewhere.
- final class JSArrayOps[T] extends AnyVal
- final class JSArrayPromiseOps[A] extends AnyVal
Extension methods for js.Array[js.Thenable[_]].
- trait JSArraySyntax extends LowerOrderJSArrayImplicits
- final class JSPromise2[A, B] extends AnyVal
- final class JSPromise3[A, B, C] extends AnyVal
- final class JSPromise4[A, B, C, D] extends AnyVal
- final class JSPromiseFailObjectOps extends AnyVal
- trait JSPromiseInstances extends AnyRef
- trait JSPromiseLowerOrderImplicits extends AnyRef
- final class JSPromiseObjectOps[A] extends AnyVal
Ergonomic syntax for Promise.resolve and Promise.reject.
Ergonomic syntax for Promise.resolve and Promise.reject. Or, use like
PromiseValue(true).resolve
.a
is a strict value. - final class JSPromiseOps[A] extends AnyVal
More ergonomic typed methods for js.Promise processing.
More ergonomic typed methods for js.Promise processing. Should just convert to Future as the overhead is *not* that much and its much easier to use. You should not import the implicit converters for js.Promise if you want to use map/flatMap on the promise itself:
import scala.scalajs.js.Thenable.Implicits._
- trait JSPromiseSyntax extends JSPromiseLowerOrderImplicits
- final class JsAnyOps[T <: Any] extends AnyOps[T]
- trait JsAnySyntax extends AnyRef
- final class JsDictionaryOps extends AnyVal
Dictionary casts.
- final class JsDynamicOps extends AnyVal
- trait JsDynamicSyntax extends AnyRef
- final class JsObjectOps[A <: Object] extends AnyVal
The "combine" methods are shallow, mutable merges, this may not be what you want.
- trait JsObjectSyntax extends AnyRef
- final case class JsOrOps[A, B](o: |[A, B]) extends Product with Serializable
Hmm...we could really tighten this up by doing |.merge and typing the picks.
- trait JsUndefLowerOrderImplicits extends AnyRef
- final class JsUndefOrBooleanOps extends UndefOrCommon[Boolean]
- final class JsUndefOrJsObject[A <: Object] extends AnyVal
- final class JsUndefOrNullOps[T] extends AnyVal
Handled js.UndefOr[T|Null] directly vs needing to flatmap into it.
Handled js.UndefOr[T|Null] directly vs needing to flatmap into it. Don't forget that scala.js has
anUndefOr.orNull
to extract the value or return null which is *not* what the methods below do. - final class JsUndefOrOps[A] extends UndefOrCommon[A]
Note that js.UndefOr and js.| already have a
.orNull
method. - final case class JsUndefOrStringOps(a: UndefOr[String]) extends UndefOrCommon[String] with Product with Serializable
- trait JsUndefOrSyntax extends JsUndefLowerOrderImplicits
- trait LowerOrderJSArrayImplicits extends AnyRef
- To do
Use sbt-boilerplace to replacite the tuple functions.
- trait MiscOrSyntax extends AnyRef
- final class Null2[A, B] extends AnyVal
- final class Null3[A, B, C] extends AnyVal
- final class Null4[A, B, C, D] extends AnyVal
- trait NullLowerOrderImplicits extends AnyRef
- final class OptionOps[T] extends AnyVal
If you want js.UndefOr, use JSConverters
.toOption
and.orUndefined
. - trait OptionSyntax extends AnyRef
- final class OrNullOps[A] extends AnyVal
It is common in interop code to model a value as A or null but not undefined even though null and undefined may both mean "absent value." See
|.merge
Many of these methods are already onjs.|
but they appear to be left biased as near as I can tell.It is common in interop code to model a value as A or null but not undefined even though null and undefined may both mean "absent value." See
|.merge
Many of these methods are already onjs.|
but they appear to be left biased as near as I can tell. I'm happy to delete these methods of that's not right and those methods usejs.UndefOr
in some way.Note that chaining many
js.|
together probably not work like you think and sometimes its better to create a new target type then target implicits to convert from each individual type (in the or) to the new target type. You must model your type asA|Null
for this implicit to be picked up.These methods exist to try and stop a conversion to
UndefOr
orOption
as part of null processing. Hey! Every bit counts!- To do
Perhaps the force get methods should throw since
.orNull
exists in the scalajs standard library now.
- final class OrNullStringOps extends AnyVal
- trait OrNullSyntax extends NullLowerOrderImplicits
- trait OrSyntax extends AnyRef
- final class OrUndefOrNullOps[A] extends AnyVal
- final class RichJSArrayTuple3[T, U, V] extends AnyVal
- final class RichJSArrayTuple4[T, U, V, W] extends AnyVal
- final class ScalaMappedOps[T] extends AnyOps[T]
Intended for directly mapped scala types, not scala.Any in general.
Intended for directly mapped scala types, not scala.Any in general. Know what you are doing!!! Very dangerous!
- trait ScalaMappedSyntax extends AnyRef
- final case class StringIntMiscOrSyntax(a: |[String, Int]) extends Product with Serializable
A data type commonly found when working with dropdown/labels.
- final class ToLocaleStringOps[A <: AnyVal] extends AnyVal
- final class UndefMap2[A, B] extends AnyVal
- final class UndefMap3[A, B, C] extends AnyVal
- final class UndefMap4[A, B, C, D] extends AnyVal
- trait UndefOrCommon[A] extends AnyRef
Add Option-like methods to js.UndefOr.
Add Option-like methods to js.UndefOr. Note that js.Undef.orNull exists in scala.js 1.0
Value Members
- case object BuildInfo extends Product with Serializable
This object was generated by sbt-buildinfo.
- object OrNullOps
- object implicits extends AllSyntax with AllInstances
- object instances extends Instances
Instances is the wrong concept here as these are not typeclass instances--but close enough as they are not syntax extensions "'element' converters" would be better similiar to
JSConverters
in scala.js. - object syntax