Problem is this:
Uncaught ReferenceError: require is not defined
<anonymous> moz-extension://b4685fc7-232c-44d9-b653-f51b7c7ea868/dist/jex_include/local-vdk_aecrypt-0.1.0/dist/jex_include/local-blakejs-1.2.1/dist/index.js:1
index.js:1:13
The issue is that blakejs is written for node and needs to be modified to work
in a browser.
Next task is doing that, but did a ton of work so taking a break
I am trying to copy the Erlang idiom of "calling" another process through a
function call interface. That is, suppose I have two named processes
corresponding to modules `caller` and `callee`
caller.erl:
foo() ->
Result = callee:get_some_data(),
do_something_with(Result).
callee.erl:
get_some_data() ->
gen_server:call(?MODULE, get_some_data)
handle_call(get_some_data, CalleeState) ->
{Result, NewState} = do_get_some_data(CalleeState),
{reply, Result, NewState}.
I'm trying to replicate that in JS, because it's definitely the most pleasant
idiom for having different processes "talk" to each other. This also allows
the callee process to define an API that black-boxes away the internal
messaging structure, thus giving the developer the flexibility to change that
internal messaging structure without breaking the calling code.