@xapp/patterns
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

@xapp/patterns

Common TypeScript design patterns and data structures.

Builder

Extend the AbstractBuilder to leverage your own builder pattern.

import { AbstractBuilder } from "@xapp/patterns";

export interface MyObject {
  foo: string;
}

export class MyBuilder extends AbstractBuilder<MyObject> {
  private foo: string = "defaultFooValue";

  public withFoo(foo: string): MyBuilder {
    return this;
  }

  public build(): MyObject {
    const { foo } = this;
    return {
      foo,
    };
  }
}

Graph

A graph is an abstract data type with vertices and edges that make the connections between them.

Tree

A tree is a data structure with a root and nodes that then expand from the root.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.22,308latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.22,308
2.0.149
2.0.00
1.0.00
1.43.600
1.43.460
1.43.380
1.43.340
1.43.40
1.42.30
1.42.10
1.42.00
1.40.3430
1.40.3220
1.40.3140
1.40.2970
1.40.2600
1.40.2390
1.40.2350
1.40.2280
1.40.2150
1.40.1970
1.40.1931
1.40.1720
1.40.1580
1.40.1530
1.40.1390
1.40.1010
1.40.830
1.40.630
1.40.340
1.40.240
1.40.210
1.40.140
1.39.670
1.39.500
1.39.410
1.39.301
1.39.250
1.39.200
1.39.130
1.39.30
1.38.20
1.38.10
1.37.290
1.37.60
1.37.00
1.35.90
1.33.270
1.33.90
1.32.1460
1.32.1430
1.32.1380
1.32.1300
1.32.1160
1.32.1140
1.32.990
1.32.820
1.32.810
1.32.780
1.32.750
1.32.660
1.32.470
1.32.190
1.32.100
1.32.80
1.32.70
1.31.220
1.31.150
1.31.70
1.29.310
1.29.110
1.29.40
1.29.10
1.27.70
1.27.60
1.27.10
1.26.600
1.26.430
1.26.370
1.26.270
1.26.250
1.25.160
1.25.120
1.25.10
1.24.620
1.24.260
1.24.220
1.24.20
1.21.70
1.18.1470
1.18.1110
1.18.960
1.18.770
1.18.530
1.18.470
1.18.270
1.18.260
1.18.250
1.18.021
1.17.210
1.17.151
1.17.100
1.16.210
1.16.180
1.16.170
1.16.50
1.14.00
1.13.81
1.7.60
1.7.2-alpha.00
1.7.10
1.6.5-alpha.00
1.6.20
1.4.130
1.4.12-alpha.10
1.4.00
1.3.00
1.0.0-beta.390
1.0.0-beta.380
1.0.0-beta.370
1.0.0-beta.340
1.0.0-beta.331
1.0.0-beta.310
1.0.0-beta.300
1.0.0-beta.280
1.0.0-beta.260
1.0.0-beta.250
1.0.0-beta.240
1.0.0-beta.60
1.0.0-beta.50
1.0.0-beta.20
1.0.0-beta.10
1.0.0-alpha.150
1.0.0-alpha.100
1.0.0-alpha.50

Package Sidebar

Install

npm i @xapp/patterns

Weekly Downloads

2,380

Version

2.0.2

License

Apache-2.0

Unpacked Size

42.2 kB

Total Files

39

Last publish

Collaborators

  • petehaas
  • michaelmyers
  • chrsdietz
  • xappbot
  • opendog