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

microstates / trafficlight
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: tm/add-chat-badge
DEFAULT BRANCH: master
Repo Added 13 Dec 2018 05:43AM UTC
Files 8
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

LAST BUILD ON BRANCH cl/union-types
branch: cl/union-types
CHANGE BRANCH
x
Reset
  • cl/union-types
  • cl/fix-linting-error
  • cl/fix-webpack-build
  • master
  • tm/add-chat-badge

pending completion
39

push

travis-ci-com

cowboyd
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();
}
```

29 of 30 branches covered (96.67%)

Branch coverage included in aggregate %.

67 of 67 relevant lines covered (100.0%)

175.34 hits per line

Relevant lines Covered
Build:
Build:
67 RELEVANT LINES 67 COVERED LINES
175.34 HITS PER LINE
Source Files on cl/union-types
  • List 0
  • Changed 4
  • Source Changed 4
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
39 cl/union-types 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 f... push 10 Jan 2019 07:54PM UTC cowboyd travis-ci-com pending completion  
40 cl/union-types 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 f... Pull #8 10 Jan 2019 07:54PM UTC web-flow travis-ci-com pending completion  
38 cl/union-types Add union types: One of the original conceptions of microstates was that it should be an effective way to use modelling your application state using state machines. One of the key insights was that there are strong analogues between types and sta... Pull #8 09 Jan 2019 10:07PM UTC web-flow travis-ci-com pending completion  
37 cl/union-types Add union types: One of the original conceptions of microstates was that it should be an effective way to use modelling your application state using state machines. One of the key insights was that there are strong analogues between types and sta... push 09 Jan 2019 10:04PM UTC cowboyd travis-ci-com pending completion  
See All Builds (16)
  • Repo on GitHub
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

© 2025 Coveralls, Inc