• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

microstates / trafficlight / 40 / 1
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: tm/add-chat-badge
DEFAULT BRANCH: master
Ran 10 Jan 2019 07:54PM UTC
Files 8
Run time 5s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jan 2019 10:06PM UTC coverage: 99.038% (+0.2%) from 98.837%
40.1

Pull #8

travis-ci-com

web-flow
Add ability to transition type.

One of the key features about using a Union type to represent a state
machine is that you must have a convenient way to transition from one
type to the next.

Previously, we were doing it by adding by returning a freshly minted
state:

```javascript

change() {
  return Color.Red.create();
}
```

This works, but is only quasi-microstate-y. Really, the microstate way
would be to provide a transition method.

This commit does just that. Instead of returning a new instance of
microstate, they `type` parameter is now smart, and hase a transition
method to every other possible member (or State) of the union type. So
the above code can be re-written:

```javascript
change() {
  return this.type.toRed();
}
```
Pull Request #8: Add union types:

32 of 33 branches covered (96.97%)

Branch coverage included in aggregate %.

71 of 71 relevant lines covered (100.0%)

61.66 hits per line

Source Files on job 40.1
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 6
  • Travis Job 40.1
  • 25d20674 on github
  • Prev Job for on cl/union-types (#34.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc