action_wire.erl 411 B

123456789101112
  1. -module(action_wire).
  2. -author('Maxim Sokhatsky').
  3. -include_lib("nitro/include/nitro.hrl").
  4. -include_lib("nitro/include/event.hrl").
  5. -compile(export_all).
  6. render_action(#wire{actions=Actions}) -> nitro:render(Actions);
  7. render_action(S) when is_list(S) -> S;
  8. render_action(_) -> [].
  9. wire(A) -> Actions = case get(actions) of undefined -> []; E -> E end,
  10. put(actions,Actions++[#wire{actions=A}]), [].