• Stars
    star
    341
  • Rank 123,998 (Top 3 %)
  • Language
    HTML
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Design patterns and idioms in JS(ES6) /w traceur

Design Patterns and Idioms in ES6

A collection of design patterns and idioms in ES6

Boilerplate forked from angular/atscript-playground

Initial setup

# Clone the repo...
git clone https://github.com/ziyasal/design-patterns-in-es6.git
cd design-patterns-in-es6

# Then, you need to install all the dependencies...
npm install

# If you want to be able to use global commands `karma` and `gulp`...
npm install -g karma-cli gulp
# Do initial build, start a webserver and re-build on every file change...
gulp build serve watch

Open a browser and see the result.

Current Patterns

Pattern Description
abstract_factory use a generic function with specific factories
adapter adapt one interface to another using a whitelist
3-tier data<->business logic<->presentation separation (strict relationships)
borg a singleton with shared-state among instances
bridge a client-provider middleman to soften interface changes
builder call many little discrete methods rather than having a huge number of constructor parameters
catalog general methods will call different specialized methods based on construction parameter
chain apply a chain of successive handlers to try and process the data
command bundle a command and arguments to call later
composite encapsulate and provide access to a number of different objects
decorator wrap functionality with other functionality in order to affect outputs
facade use one class as an API to a number of others
factory_method delegate a specialized function/method to create instances
flyweight transparently reuse existing instances of objects with similar/identical state
graph_search (graphing algorithms, not design patterns)
mediator an object that knows how to connect other objects and act as a proxy
memento generate an opaque token that can be used to go back to a previous state
mvc model<->view<->controller (non-strict relationships)
observer provide a callback for notification of events/changes to data
pool preinstantiate and maintain a group of instances of the same type
prototype use a factory and clones of a prototype for new instances (if instantiation is expensive)
proxy an object funnels operations to something else
publish_subscribe a source syndicates events/data to 0+ registered listeners
state logic is org'd into a discrete number of potential states and the next state that can be transitioned to
strategy selectable operations over the same data
template an object imposes a structure but takes pluggable components
visitor invoke a callback for all items of a collection
chaining_method continue callback next object method
iterator Provide a way to access the elements of an aggregate object sequentially

What are all the pieces involved?

Traceur

Transpiles AtScript code into regular ES5 (today's JavaScript) so that it can be run in a current browser.

RequireJS

Traceur is configured to transpile AtScript modules into AMD syntax and we use RequireJS to load the code in the browser.

Assert library

When typeAssertions: true option is used, Traceur generates run-time type assertions such as assert.type(x, Object). The assert library does the actual run-time check. Of course, you can use your own assert library.

The idea with type assertions is that you only use them during the development/testing and when deploying, you use typeAssertions: false.

Karma

Test runner that runs the tests in specified browsers, every time that you change a file.

Gulp

Task runner to make defining and running the tasks simpler.

More Repositories

1

FireSharp

An asynchronous cross-platform .Net library for Firebase
C#
695
star
2

scientist.js

πŸ”¬ A JavaScript interpretation of the Ruby library Scientist, a library for carefully refactoring critical paths.
JavaScript
606
star
3

vscode-open-in-github

Extension for Visual Studio Code which can be used to jump to a source code line in Github, Bitbucket, GitLab and Visualstudio.com
JavaScript
193
star
4

rdash-angular2

RDash admin dashboard theme /w AngularJS2 & TypeScript
HTML
182
star
5

InfluxDB.Net

Cross-platform .NET library for InfluxDB distributed time-series database.
C#
165
star
6

pyley

Python package for an open-source graph database Cayley
Python
159
star
7

hapijs-status-monitor

πŸš€ Realtime Monitoring solution for Hapi.js apps
JavaScript
137
star
8

Caliburn.Metro

A library that combines MahApps.Metro with Caliburn.Micro for Metro UI styled WPF applications.
C#
110
star
9

socket.io-python-emitter

Python implementation of socket.io-emitter that provides a hook point to easily allow you to emit events to browsers from anywhere πŸš€
Python
74
star
10

reducio

❱ πŸ‡ URL shortener service is written in Scala using Akka-Http and Redis ❰
Scala
69
star
11

natura

A simple, efficient spring animation library for smooth, natural motion in Rust
Rust
67
star
12

Disque.Net

.Net library for the Disque distributed, in-memory message broker (i.e Redis as a job queue)
C#
56
star
13

Autofac.Extras.NLog

An Autofac module to integrate Autofac and NLog, it supports both constructor and property injection.
C#
50
star
14

Httwrap

General purpose, simple but useful HttpClient wrapper for .NET & Xamarin/Mono
C#
45
star
15

distrox

A fast thread-safe in-memory cache (storage) library and server that supports a big number of entries in Go
Go
37
star
16

angular-es6-webpack-boilerplate

AngularJS 1.4x and ES6 application boilerplate /w testing practices using Webpack
JavaScript
36
star
17

socket.io-go-emitter

Go implementation of socket.io-emitter
Go
24
star
18

AspNetWebApi-OutputCache-Redis

Redis cache for AspNetWebApi-OutputCache
C#
22
star
19

AspNet.Mvc.Theming

Enables implementing themes for ASP.NET MVC.
C#
21
star
20

Helmet

Middlewares to help secure your apps
C#
19
star
21

ProceXSS

ProceXSS is an Asp.NET Http module -tries- to prevent to xss attacks.
C#
15
star
22

neurolog

Go inteface to access `neural-redis`
Go
12
star
23

ioredis-eventemitter

Redis pubsub using an event emitter via ioredis Redis client for Node.js
JavaScript
11
star
24

consulr

Decode Consul KV data into JSON in Node.js and watch for updates
JavaScript
11
star
25

FunnyBus

Simple event aggregator/messenger for .net applications.
C#
10
star
26

Owin.Security.RedisTokenProviders

A RefreshTokenProvider using Redis as token store for Microsoft.Owin
C#
10
star
27

Panteon.Sdk

A distributed scheduled real-time task processing server for .NET
C#
10
star
28

atom-open-conemu-here

Adds a shortcut to Tree View - Open ConEmu Here in the context menu
CoffeeScript
9
star
29

redisetup

Redis setup scripts
Shell
9
star
30

k8splunk

Send kubernetes logs to splunk using fluentd
Smarty
8
star
31

Sentiment

Sentiment analysis using VADER in Scala
Scala
8
star
32

Reserveon

Sample reactive Movie Ticket reservation system written in Scala on akka-http with slick, postgres and redis
Scala
8
star
33

rock-paper-scissors-extended-java

Rock, Paper, Scissors game implementation with additional weapons support.
Java
7
star
34

Panteon.Host

A distributed scheduled real-time task processing server for .NET built on Schyntax, cs-schtick.redis and Redis for locking.
C#
6
star
35

csharp-trampolining-tail-call

C# implement trampolin to tail recursion
C#
6
star
36

arf

Powerful math lib for Vector, Matrix and Quaternion operations
Rust
5
star
37

node-procexss

Middleware to help to prevent xss attacks in your Express/Connect apps
JavaScript
5
star
38

panteon-dashboard

Panteon Web UI
JavaScript
5
star
39

Peximet

Akka cluster sample on Kubernetes
Scala
3
star
40

scream-processing

Playground for Apache Kafka, Apache Flink (CEP & ML), Elasticsearch, Kibana in Scala /w Testing practices
3
star
41

Common.Testing.NUnit

Provides base class with generic methods for testing
C#
3
star
42

AspNet.Mvc.ConfigurationExporter

Makes server side configurations are available on client side
C#
3
star
43

cerebro

Finding The Median In Large Sets Of Numbers Split Across N Servers using zeromq and nodejs (experimental)
JavaScript
3
star
44

bugthesystem

2
star
45

utopia

πŸš€ ⇴ Β΅topia
C++
2
star
46

socket.io-rabbitmq

socket.io adapter rabbitmq implementation
JavaScript
2
star
47

wasm-emc2

πŸš€ C++ Webassembly experiments using Emscripten
C++
2
star
48

statsy

πŸ”₯ Calculates the median and average of large stream of data using count sort
JavaScript
2
star
49

pmecs

Poor man's Entity Component System
Rust
2
star
50

socket.io-rabbitmq-emitter

socket.io emitter implementation
JavaScript
2
star
51

dataloader

DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a consistent API over various backends and reduce requests to those backends via batching and caching.
Scala
2
star
52

Exncod

Exncod - fast url encode
C#
2
star
53

Panteon.Realtime.Pusher

Add real-time functionalities to tasks and dashboard using Pusher
C#
2
star
54

rock-paper-scissors-extended-nodejs

Rock, Paper, Scissors game implementation with additional weapons support.
JavaScript
2
star
55

docker-containers

come in!
Puppet
1
star
56

socket.io-rabbitmq-server

socket.io pub-sub server rabbitmq implementation
JavaScript
1
star
57

skala-vert.x

Vert.x sample using scala
Scala
1
star
58

HandyEx

Small handy extensions in C#
C#
1
star
59

Panteon.HistoryStorage

Panteon history storage implementations (sql server, mongodb etc)
C#
1
star
60

autopoco.js

Simple test data creator
JavaScript
1
star
61

ymal

Little command line utility for modifiying YAML files
JavaScript
1
star
62

hodor

An Authorization server based on "Zanzibar: Google’s Consistent, Global Authorization System"
1
star
63

Transformer

Poor man's mapping library - its not AUTO.
C#
1
star
64

polygon-utils

Ray-casting algorithm to determine if point is inside a polygon
Scala
1
star
65

polylabel

A fast algorithm for finding the pole of inaccessibility of a polygon
Scala
1
star