summaryrefslogtreecommitdiffstats
path: root/src/core/ephraim_account_event_proxy.erl
blob: 9f52d102b393952fac9c992908291fa23efa2959 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-module(ephraim_account_event_proxy).
-behaviour(advanced_event).

-export([start/2]).
-export([init/1, handle_event/2, handle_call/2, handle_info/2, terminate/2, code_change/3]).

start(Account, EventManager) ->
    advanced_event:add_handler(EventManager, ?MODULE, Account).

init(Account) ->
    {ok, Account}.

handle_event({view_update, Event}, Account) ->
    ephraim:notify({view_update, {account, Account, Event}}),
    {ok, Account};
    
handle_event(_Event, Account) ->
    {ok, Account}.

handle_call(_Msg, Account) ->
    {noreply, Account}.
handle_info(_Msg, Account) ->
    {ok, Account}.
terminate(_Reason, _Account) ->
    ok.
code_change(_OldVersion, Account, _Extra) ->
    {ok, Account}.