Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify events config to follow the same form as docs #268

Closed
Euen opened this issue Sep 19, 2016 · 2 comments
Closed

Modify events config to follow the same form as docs #268

Euen opened this issue Sep 19, 2016 · 2 comments

Comments

@Euen
Copy link
Member

Euen commented Sep 19, 2016

Replace {model, event_manager_module} instead of {doc_module, event_manager_module}

@cabol
Copy link
Contributor

cabol commented Mar 29, 2017

@Euen (/cc @elbrujohalcon) I think we support this already, we actually are handling the event in that way {model, event_manager_module}, check this out: https://github.com/inaka/sumo_db/blob/master/src/sumo_config.erl#L47

As you can see, the event config is defined as {DocName :: atom(), EventHandler :: module()}, where the DocName is the name of the model.

What we can do is make it more explicit, like this:

-type event_config() :: {SchemaName :: sumo:schema_name(), EventHandler :: module()}.

And this actually applies to the doc config as well:

-type doc_config() :: {SchemaName :: sumo:schema_name(), Store :: atom(), Props :: map()}.

What do you guys think?

@elbrujohalcon
Copy link
Member

@cabol I'm not sure… I think @Euen and I needed to use the module in our config files for this to work. Are you sure it works, despite of that spec?

And yes… you can use sumo:schema_name() there, I'm cool with that.

@cabol cabol closed this as completed Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants