Skip to content

Commit

Permalink
Clarify commute docs
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed May 13, 2014
1 parent 96745c8 commit 5020177
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ var commute = require('jiff/lib/commute');
var [p2c, p1c] = commute(p1, p2);
```

Given two patches `p1` and `p2`, which are intended to be applied in the order `p1` then `p2`, transform them so that they can be safely applied in the order `p2` and then `p1`.
Given two patches `p1` and `p2`, which are intended to be applied in the order `p1` then `p2`, transform them so that they can be safely applied in the order `p2c` and then `p1c`.

Commutation is currently *highly experimental*. It works for patch operations whose path refers to a common array ancestor by transforming array indices. Operations that share a common object ancestor are simply swapped for now, which is likely not the right thing in most cases!

Expand Down

0 comments on commit 5020177

Please sign in to comment.