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

microstates / trafficlight / 40
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: tm/add-chat-badge
DEFAULT BRANCH: master
Ran 10 Jan 2019 07:54PM UTC
Jobs 1
Files 8
Run time 13s
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

pending completion
40

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 %.

33 of 33 new or added lines in 3 files covered. (100.0%)

71 of 71 relevant lines covered (100.0%)

61.66 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40.1 10 Jan 2019 07:54PM UTC 0
99.04
Travis Job 40.1
Source Files on build 40
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #40
  • Pull Request #8
  • PR Base - master (#34)
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