diff options
Diffstat (limited to 'src/core/ephraim_account_event_proxy.erl')
-rw-r--r-- | src/core/ephraim_account_event_proxy.erl | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/core/ephraim_account_event_proxy.erl b/src/core/ephraim_account_event_proxy.erl new file mode 100644 index 0000000..d9cf94e --- /dev/null +++ b/src/core/ephraim_account_event_proxy.erl @@ -0,0 +1,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}. |