mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 06:27:02 +03:00
Underscore.js _.each() to native Array.forEach() (optional with Object.entries/values)
This commit is contained in:
parent
178e5f6ef7
commit
a5d41edb24
25 changed files with 72 additions and 79 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import _ from '_';
|
||||
import { isObject, isUnd } from 'Common/Utils';
|
||||
import * as Plugins from 'Common/Plugins';
|
||||
|
||||
|
|
@ -14,7 +13,7 @@ export function sub(name, func, context) {
|
|||
context = func || null;
|
||||
func = null;
|
||||
|
||||
_.each(name, (subFunc, subName) => {
|
||||
Object.entries(name).forEach(([subFunc, subName]) => {
|
||||
sub(subName, subFunc, context);
|
||||
});
|
||||
} else {
|
||||
|
|
@ -34,7 +33,7 @@ export function pub(name, args) {
|
|||
Plugins.runHook('rl-pub', [name, args]);
|
||||
|
||||
if (!isUnd(SUBS[name])) {
|
||||
_.each(SUBS[name], (items) => {
|
||||
SUBS[name].forEach(items => {
|
||||
if (items[0]) {
|
||||
items[0].apply(items[1] || null, args || []);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue