PhoenixGon: Phoenix variables in Javascript simply

PhoenixGon

Tool that help keep phoenix variables in javascript code.

Hex: https://hex.pm/packages/phoenix_gon
Docs: https://hexdocs.pm/phoenix_gon/api-reference.html
Github: https://github.com/khusnetdinov/phoenix_gon

6 Likes

Interesting, so it is just a convenient way to inject some values as JSON into a javascript code snippet, useful abstraction. :slight_smile:

1 Like

Nice work! I have just one suggestion. Since you don’t need to rely on code injection, I would kill off the use PhoenixGon.Controller and use PhoenixGone.View in favor of simply importing the functions in the module. Since this lib is Just a Plug^tm with supporting functions we don’t need code injection and use indirection. This is a neat little lib :slight_smile:

3 Likes

Done! Use is removed.

5 Likes

:heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes::heart_eyes:

4 Likes

Star on repo is better )))

1 Like

Does this hang everything on window.gon the way Ruby Gon does?

1 Like

It does. Idea for this hex was taken from ruby gon.

1 Like