【文件属性】:
文件名称:js_gen_server:通过Elixir中的GenServer公开JS功能
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-22 15:40:40
Elixir
JSGenServer
简单的端口包装程序,用于将JavaScript函数公开给Elixir。 可以使用在JSON中简单地对传递的参数进行编码和解码。 (主要是占位符,因为可以使用更有效的传输编码。)
地位
早期的原型/概念验证。
基本范例
// adder.js
function Server ( state , module ) {
this . state = state ;
this . module = module ;
} ;
Server . prototype . add = function ( args ) {
return args . reduce ( function ( a , b ) { return a + b } ) ;
} ;
Server . prototype . twoarg = function ( a , b ) {
ret
【文件预览】:
js_gen_server-master
----mix.exs(848B)
----priv()
--------genserver.js(4KB)
----lib()
--------js_gen_server.ex(4KB)
----examples()
--------react.md(948B)
--------webpack.md(898B)
----config()
--------config.exs(1KB)
----LICENSE(1KB)
----test()
--------js_gen_server_test.exs(1KB)
--------fixtures()
--------test_helper.exs(15B)
----README.md(2KB)
----.gitignore(44B)