Skip to main content Link Search Menu Expand Document (external link)

CurrentRoute overview

Added in v1.0.0


Table of contents


utils

CurrentParams

Signature

export declare const CurrentParams: Fx.RefSubject.Filtered<
  Readonly<Record<string, string | readonly string[]>>,
  never,
  Navigation | CurrentRoute
>

Added in v1.0.0

CurrentRoute

Signature

export declare const CurrentRoute: Context.Tagged<CurrentRoute, CurrentRoute>

Added in v1.0.0

CurrentRoute (interface)

Signature

export interface CurrentRoute {
  readonly route: Route.Route.Any
  readonly parent: Option.Option<CurrentRoute>
}

Added in v1.0.0

CurrentSearchParams

Signature

export declare const CurrentSearchParams: Fx.RefSubject.Computed<Readonly<Record<string, string>>, never, Navigation>

Added in v1.0.0

CurrentState

Signature

export declare const CurrentState: Fx.RefSubject.Computed<unknown, never, Navigation>

Added in v1.0.0

browser

Signature

export declare const browser: Layer.Layer<CurrentRoute, never, Document.Document>

Added in v1.0.0

decode

Signature

export declare function decode<R extends Route.Route.Any>(
  route: R
): Fx.RefSubject.Filtered<
  Route.Route.Type<R>,
  Route.RouteDecodeError<R>,
  Navigation | CurrentRoute | Route.Route.Context<R>
>

Added in v1.0.0

isActive

Signature

export declare function isActive<R extends Route.Route.Any>(
  route: R,
  ...[params]: Route.Route.ParamsList<R>
): RefSubject.Computed<boolean, never, Navigation | CurrentRoute>
export declare function isActive<R extends Route.Route.Any>(
  route: R,
  params: Route.Route.Params<R>
): RefSubject.Computed<boolean, never, Navigation | CurrentRoute>

Added in v1.0.0

layer

Signature

export declare function layer<R extends Route.Route.Any>(
  route: R,
  parent: Option.Option<CurrentRoute> = Option.none()
): Layer.Layer<CurrentRoute>

Added in v1.0.0

makeCurrentRoute

Signature

export declare function makeCurrentRoute<R extends Route.Route.Any>(
  route: R,
  parent: Option.Option<CurrentRoute> = Option.none()
): CurrentRoute

Added in v1.0.0

makeHref

Signature

export declare function makeHref<const R extends Route.Route.Any>(
  route: R,
  ...[params]: Route.Route.ParamsList<R>
): RefSubject.Filtered<string, never, Navigation | CurrentRoute>

Added in v1.0.0

server

Signature

export declare const server: (base?: string) => Layer.Layer<CurrentRoute>

Added in v1.0.0

withCurrentRoute

Signature

export declare const withCurrentRoute: {
  <R extends Route.Route.Any>(
    route: R
  ): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, CurrentRoute>>
  <A, E, R, R_ extends Route.Route.Any>(
    effect: Effect.Effect<A, E, R>,
    route: R_
  ): Effect.Effect<A, E, Exclude<R, CurrentRoute>>
}

Added in v1.0.0