GitHubページに例jsコードがありますが、問題が発生していますが、サイクルブレスで実験しています。Babel、予期せぬトークン(15:33)::
import { run } from '@cycle/core';
import blessed from 'blessed';
import { makeTermDriver, box } from 'cycle-blessed';
import { Observable as $ } from 'rx';
let screen = blessed.screen({ smartCSR: true, useBCE: true, title:
'Hello, World!' });
let BlueBox = text => box({ border: { type: 'line', fg: 'blue' } },
text);
run(({ term }) => ({
term: $.just(BlueBox('Hello, World!')),
exit: term.on('key C-c')
}), {
term: makeTermDriver(screen),
exit: exit$ => exit$.forEach(::process.exit)
});
私はこのコードがバベルで実行できると信じているが、実行しようとしている:に使用することができます
13 | }), {
14 | term: makeTermDriver(screen),
15 | exit: exit$ => exit$.forEach(::process.exit)
| ^
16 | });
・アム私は思考バベルの中に訂正:
./node_modules/.bin/babel src -d dest
結果でこのコードを書き換えますか?
助けてください。
.babelrc:
{
"presets": ["es2015"]
}
{
"plugins": ["transform-function-bind"]
}
:: process.exitは、パラメータ項目として受け取る関数でありますか? –