Skip to content

Commit

Permalink
remove dependency on Poison and use Jason instead (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarzan authored Jan 11, 2019
1 parent 108618a commit 2ef47a5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
19 changes: 10 additions & 9 deletions lib/ex_cell/adapters/cell_js.ex
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,16 @@ defmodule ExCell.Adapters.CellJS do
the default `data-cell` and `data-cell-params` attributes.
"""
def data_attribute(name, id, data \\ [], params \\ %{})
def data_attribute(name, id, nil, params), do:
data_attribute(name, id, [], params)
def data_attribute(name, id, data, params), do:
Keyword.merge(
data,
cell: name,
cell_id: id,
cell_params: Poison.encode!(params)
)
def data_attribute(name, id, nil, params), do: data_attribute(name, id, [], params)

def data_attribute(name, id, data, params),
do:
Keyword.merge(
data,
cell: name,
cell_id: id,
cell_params: Jason.encode!(params)
)

@doc """
The attributes function is used to auto fill the attributes for a container
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ defmodule ExCell.Mixfile do
{:mix_test_watch, "~> 0.3", only: :dev, runtime: false},
{:phoenix_html, "~> 2.10"},
{:phoenix, "~> 1.4.0", optional: true},
{:poison, "~> 4.0"},
{:jason, "~> 1.1"},
{:elixir_uuid, "~> 1.2"}
]
end
Expand Down
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"phoenix_pubsub": {:hex, :phoenix_pubsub, "1.1.1", "6668d787e602981f24f17a5fbb69cc98f8ab085114ebfac6cc36e10a90c8e93c", [:mix], [], "hexpm"},
"plug": {:hex, :plug, "1.7.1", "8516d565fb84a6a8b2ca722e74e2cd25ca0fc9d64f364ec9dbec09d33eb78ccd", [:mix], [{:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}], "hexpm"},
"plug_crypto": {:hex, :plug_crypto, "1.0.0", "18e49317d3fa343f24620ed22795ec29d4a5e602d52d1513ccea0b07d8ea7d4d", [:mix], [], "hexpm"},
"poison": {:hex, :poison, "4.0.1", "bcb755a16fac91cad79bfe9fc3585bb07b9331e50cfe3420a24bcc2d735709ae", [:mix], [], "hexpm"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.4", "f0eafff810d2041e93f915ef59899c923f4568f4585904d010387ed74988e77b", [:make, :mix, :rebar3], [], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"},
}

0 comments on commit 2ef47a5

Please sign in to comment.