Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
New bs version
Browse files Browse the repository at this point in the history
  • Loading branch information
chenglou committed Mar 20, 2018
1 parent 4a08a9b commit d87c28a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 19 deletions.
3 changes: 1 addition & 2 deletions lib/js/src/async/Counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
var Block = require("bs-platform/lib/js/block.js");
var Curry = require("bs-platform/lib/js/curry.js");
var React = require("react");
var Pervasives = require("bs-platform/lib/js/pervasives.js");
var ReasonReact = require("reason-react/lib/js/src/ReasonReact.js");

var component = ReasonReact.reducerComponent("Counter");

function make() {
var newrecord = component.slice();
newrecord[/* render */9] = (function (param) {
return React.createElement("div", undefined, Pervasives.string_of_int(param[/* state */2][/* count */0]));
return React.createElement("div", undefined, String(param[/* state */2][/* count */0]));
});
newrecord[/* initialState */10] = (function () {
return /* record */[/* count */0];
Expand Down
1 change: 0 additions & 1 deletion lib/js/src/todomvc/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ function make() {
/* todos */todos
]]);
}
break;
case 1 :
return /* NoUpdate */0;
case 2 :
Expand Down
3 changes: 1 addition & 2 deletions lib/js/src/todomvc/TodoFooter.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

var React = require("react");
var Pervasives = require("bs-platform/lib/js/pervasives.js");
var ReasonReact = require("reason-react/lib/js/src/ReasonReact.js");

var component = ReasonReact.statelessComponent("TodoFooterRe");
Expand Down Expand Up @@ -50,7 +49,7 @@ function make(count, completedCount, nowShowing, onClearCompleted, _) {
className: "footer"
}, React.createElement("span", {
className: "todo-count"
}, React.createElement("strong", undefined, Pervasives.string_of_int(count)), " " + (activeTodoWord + " left")), React.createElement("ul", {
}, React.createElement("strong", undefined, String(count)), " " + (activeTodoWord + " left")), React.createElement("ul", {
className: "filters"
}, React.createElement("li", undefined, React.createElement("a", {
className: match$2[0],
Expand Down
20 changes: 7 additions & 13 deletions lib/js/src/todomvc/TodoItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,12 @@ function make(todo, editing, onDestroy, onSave, onEdit, onToggle, onCancel, _) {
newrecord[/* didUpdate */5] = (function (param) {
var match = param[/* oldSelf */0][/* state */2][/* editing */1];
var match$1 = param[/* newSelf */1][/* state */2][/* editFieldRef */2][0];
if (match !== 0) {
if (match !== 0 || !(editing !== 0 && match$1)) {
return /* () */0;
} else if (editing !== 0) {
if (match$1) {
var field = match$1[0];
field.focus();
field.setSelectionRange(field.value.length, field.value.length);
return /* () */0;
} else {
return /* () */0;
}
} else {
var field = match$1[0];
field.focus();
field.setSelectionRange(field.value.length, field.value.length);
return /* () */0;
}
});
Expand Down Expand Up @@ -116,16 +110,16 @@ function make(todo, editing, onDestroy, onSave, onEdit, onToggle, onCancel, _) {
});
newrecord[/* reducer */12] = (function (action) {
if (typeof action === "number") {
if (action) {
return submitHelper;
} else {
if (action === 0) {
return (function (state) {
return /* Update */Block.__(0, [/* record */[
/* editText */todo[/* title */1],
/* editing */state[/* editing */1],
/* editFieldRef */state[/* editFieldRef */2]
]]);
});
} else {
return submitHelper;
}
} else if (action.tag) {
var text = action[0];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"todomvc-common": "^1.0.1"
},
"devDependencies": {
"bs-platform": "^2.2.2",
"bs-platform": "^2.2.3",
"concurrently": "^3.5.0",
"webpack": "^1.14.0"
}
Expand Down

0 comments on commit d87c28a

Please sign in to comment.