Skip to content

Commit

Permalink
Merge pull request #33 from twop/master
Browse files Browse the repository at this point in the history
small fix for '{}' unit type in transform part of readme
  • Loading branch information
pelotom authored Apr 22, 2018
2 parents eb9f5ef + d391d4b commit 543fc06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ const Light = unionize({ On: ofType<{ percentage: number }>(), Off: {} });
const turnOn = Light.transform({ Off: () => Light.On({ percentage: 100 }) });
const dim = Light.transform({ On: prev => Light.On({ percentage: prev.percentage / 2 }) });

const off = Light.Off({});
const off = Light.Off();
const dimmed = dim(off); //didn't match. so dimmed === off
const on = turnOn(off);

// can accept an object right away
const toggled = Light.transform(on, {
On: () => Light.Off({}),
On: () => Light.Off(),
Off: () => Light.On({ percentage: 50 }),
});
```
Expand Down

0 comments on commit 543fc06

Please sign in to comment.