summaryrefslogtreecommitdiffstats
path: root/src/core/ephraim_account_event_proxy.erl
blob: d9cf94e8355e08a7b5be1e6878c90c48c41031b3 (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(gen_event).

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

start(EventManager) ->
    gen_event:add_handler(EventManager, ?MODULE, foo_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}.