Optimistic updates
Open
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
Assessment
This issue has not been assessed yet.