grych / grych/drab

Optimistic updates

Open
#64 3 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
878
Forks
44
PR merge metrics
No merged PRs in 30d

Description

In analogy to `execjs`, we could integrate ElixirScript into Drab and write the whole stuff in Elixir only.

```elixir
exec socket do
Todo.Data.Http.fetch("/api/todo").then(fn(response) ->
response.json()
end).then(fn(todos) ->
todos
|> Enum.map(fn(x) -> %Todo.Todo{ id: x.id, completed: x.completed, title: x.title } end)
|> Todo.Main.update()
end).catch(fn(err) ->
Todo.Data.Http.log(err)
end)
end
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.