Skip to main content
Module

x/careful/mod.ts>Container

Safe containerization of values for TypeScript
Latest
class Container
Re-export
import { Container } from "https://deno.land/x/careful@v0.1.0/mod.ts";

Container is a base class for all entities that have a value and a trackId.

Constructors

new
Container(value: T, trackId?: NullOr<string>)

Type Parameters

T
  • The type of the value.

Properties

protected
_error: NullOr<Error>
protected
_trackId: string
protected
readonly
_value: T

Methods

getTrackId(): string
onError(cb: (err: Error) => void)
pass(cb: (value: T, trackId: string) => void)
setTrackId(trackId: string)