Node: A
Sign in

< back

Bucketier, My First hex.pm Contribution
– Andi, 2018-07-21

Today, I wrote my first HEX-package and published it on “hex.pm”. It is an extract of my daily work and was part of an “Umbrella-App” initially.

It is in a very early stage, and a lot of work will be necessary to make it a mature and useful contribution. But, wait and see ;-)

Usage

Bucket.bucket("shopping list")
 |> Bucket.put(1, "Milk")
 |> Bucket.put(2, "Bread")
 |> Bucket.commit()

Bucket.bucket("shopping list")
# %Bucket{name: "shopping list", data: %{1 => "Milk", 2 => "Bread"}}

Bucket.get("shopping list", 1)
# "Milk"

Bucket.values("shopping list")
# ["Milk", "Bread"]

Bucket.keys("shopping list")
# [1,2]

The keys, of course, can be anything. It is not restricted to integers.