Closed Fredrik-Oberg closed 8 years ago
I think I can try do that, but got one question. Overriding all settings of notification will be right, or should it only override specific settings?
@godric3 i would say override all settings, so a notification should be able to take in the same settings object as the lib itself.
Only override settings that you send in.
I think you can use Object.assign
for this to work.
Something in the line like this I believe would do it.
var createNotification = function (_message, type, customSettings) {
var settings = Object.assign({}, lib.settings.notification, customSettings);
var ttl = settings.time;
}
Then we will only overwrite the settings for that notification.
* edited javascript variable name
Should be able to add custom settings per each notification.