Skip to content

Commit

Permalink
Clarify the import in docs
Browse files Browse the repository at this point in the history
Fixes #263
  • Loading branch information
gaearon committed Sep 15, 2015
1 parent 95cfd15 commit 306ca72
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/00 Quick Start/Tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,11 @@ Finally, I'm adding a `canMoveKnight` check to the `handleSquareClick` method:

-------------------
```js
var canMoveKnight = require('./Game').canMoveKnight;
var moveKnight = require('./Game').moveKnight;

/* ... */

handleSquareClick: function (toX, toY) {
if (canMoveKnight(toX, toY)) {
moveKnight(toX, toY);
Expand All @@ -930,6 +935,10 @@ handleSquareClick: function (toX, toY) {
```
-------------------
```js
import { canMoveKnight, moveKnight } from './Game';

/* ... */

handleSquareClick(toX, toY) {
if (canMoveKnight(toX, toY)) {
moveKnight(toX, toY);
Expand Down Expand Up @@ -1832,4 +1841,4 @@ Happy dragging and dropping.
<img src='https://s3.amazonaws.com/f.cl.ly/items/1F2g2F0D470X0d0k2A1U/Screen%20Recording%202015-05-15%20at%2002.22%20pm.gif' width='404' height='445' alt='Screenshot'>
Now go and [play with it](examples-chessboard-tutorial-app.html)!
Now go and [play with it](examples-chessboard-tutorial-app.html)!

0 comments on commit 306ca72

Please sign in to comment.