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

Use notie.alert with an enum for types? #28

Closed
skvale opened this issue Nov 17, 2015 · 8 comments
Closed

Use notie.alert with an enum for types? #28

skvale opened this issue Nov 17, 2015 · 8 comments

Comments

@skvale
Copy link

skvale commented Nov 17, 2015

I find it easier to remember enums than numbers.

README.md

notie.alert(notie.types.SUCCESS, 'Success!', 1.5);
notie.alert(notie.types.WARNING, 'Warning<br><b>with</b><br><i>HTML</i><br><u>included.</u>', 2);
notie.alert(notie.types.ERROR, 'Error.', 2.5);
notie.alert(notie.types.INFO, 'Information.' 2);

notie.js

var types = {
    SUCCESS: 1,
    WARNING: 2,
    ERROR: 3,
    INFO: 4
}
.....
return {
   alert: alert,
   confirm: confirm,
   input: input,
   types: types
};
@skvale
Copy link
Author

skvale commented Nov 17, 2015

This fork

@jaredreich
Copy link
Owner

Thanks for the feedback though it's definitely easier to type "2" than "notie.types.WARNING". Feel free to pursue this on your forks!

@skvale
Copy link
Author

skvale commented Nov 18, 2015

Sounds good, thanks for considering it. It would still work to type either 2 or notie.types.WARNING .

@jaredreich
Copy link
Owner

Ah I see thank you for explaining. Perhaps I will still implement this. Thanks again.

@skvale
Copy link
Author

skvale commented Nov 18, 2015

Let me know if you would like me to open a pull request.

@connorjburton
Copy link

I think enums would be a good idea along with simple integers, just thinking if there is a way to reference them without going through notie.types.X

@jaredreich
Copy link
Owner

I'm still not convinced how notie.type.success is easier to remember than "1". It's unlikely there'll ever be more than 4 categories (sucess/error/warning/info) so is remembering that 1-4 are your choices really not sufficient? Just my $0.02

@carcinocron
Copy link

It's unlikely there'll ever be more than 4 categories (sucess/error/warning/info)

I'll definitely be nuking my fork with up to 16 variations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants