-module(action_wire). %%-author('Maxim Sokhatsky'). -include_lib("nitro/include/nitro.hrl"). -include_lib("nitro/include/event.hrl"). -export([ render_action/1, wire/1 ]). render_action( #wire{actions = Actions} ) -> nitro:render(Actions); render_action(S) when erlang:is_list(S) -> S; render_action(_) -> []. wire(A) -> Actions = case erlang:get(actions) of undefined -> []; E -> E end, erlang:put(actions, Actions ++ [ #wire{actions = A} ]), [].