Skip to content

Commit ca405a7

Browse files
committed
Using brunch again
1 parent 0286b98 commit ca405a7

File tree

5 files changed

+16
-52
lines changed

5 files changed

+16
-52
lines changed

config/dev.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config :todo, Todo.Endpoint,
1111
debug_errors: true,
1212
code_reloader: true,
1313
check_origin: false,
14-
watchers: [npm: ["run", "watch",
14+
watchers: [node: ["node_modules/brunch/bin/brunch", "watch", "--stdin",
1515
cd: Path.expand("../", __DIR__)], mix: ["elixirscript.watch"]]
1616

1717

lib/todo/store.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Todo.Store do
1414

1515
def add(title) do
1616
Agent.update(__MODULE__, fn(state) ->
17-
Map.put(state, Set.size(state), %Todo.Models.Todo{ title: title, completed: false, id: Set.size(state) })
17+
Map.put(state, length(Map.keys(state)), %Todo.Models.Todo{ title: title, completed: false, id: length(Map.keys(state)) })
1818
end)
1919
end
2020

package.json

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@
22
"repository": {},
33
"license": "MIT",
44
"scripts": {
5-
"deploy": "webpack -p",
6-
"watch": "webpack --watch-stdin --color"
5+
"deploy": "brunch build --production",
6+
"watch": "brunch watch --stdin"
77
},
88
"dependencies": {
99
"phoenix": "file:deps/phoenix",
10-
"phoenix_html": "file:deps/phoenix_html"
10+
"phoenix_html": "file:deps/phoenix_html",
11+
"react": "^15.4.0",
12+
"react-dom": "^15.4.0"
1113
},
1214
"devDependencies": {
13-
"babel-core": "6.21.0 ",
14-
"babel-preset-env": "1.1.4",
15-
"react": "^15.4.0",
16-
"react-dom": "^15.4.0",
17-
"babel-loader": "^6.2.10",
18-
"css-loader": "^0.26.1",
19-
"raw-loader": "^0.5.1",
20-
"style-loader": "^0.13.1",
21-
"webpack": "^2.2.0",
22-
"copy-webpack-plugin": "^4.0.1",
23-
"extract-text-webpack-plugin": "^2.0.0-beta.4"
15+
"babel-brunch": "~6.0.0",
16+
"brunch": "2.7.4",
17+
"clean-css-brunch": "~2.0.0",
18+
"css-brunch": "~2.0.0",
19+
"javascript-brunch": "~2.0.0",
20+
"uglify-js-brunch": "~2.0.1",
21+
"babel-preset-env": "1.1.4"
2422
}
2523
}

web/static/exjs/data.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ defmodule Todo.Data do
2626
end
2727

2828
def remove(id) do
29-
:window.fetch("/api/todo/#{id}", %{ "method" => "delete" }).then(fn(response) ->
29+
:window.fetch("/api/todo/" <> id, %{ "method" => "delete" }).then(fn(response) ->
3030
list()
3131
end).catch(fn(err) ->
3232
:console.debug(err)
3333
end)
3434
end
3535

3636
def update(id, completed) do
37-
:window.fetch("/api/todo/#{id}", %{
37+
:window.fetch("/api/todo/" <> id, %{
3838
"method" => "put",
3939
"headers" => %{
4040
"Content-type" => "application/json"

webpack.config.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)