Skip to content

Instantly share code, notes, and snippets.

@amio
Last active July 10, 2020 11:32
Show Gist options
  • Save amio/1ef41ca368658bf59629d10dae120d07 to your computer and use it in GitHub Desktop.
Save amio/1ef41ca368658bf59629d10dae120d07 to your computer and use it in GitHub Desktop.
not-so-pretty
-    (response.code !== undefined
-      && response.code !== 0
-      && response.code !== 'aeolus/ok'
-      && response.code !== 'notification/ok')
+    (response.code !== undefined &&
+      response.code !== 0 &&
+      response.code !== 'aeolus/ok' &&
+      response.code !== 'notification/ok')
-  const getLoading = {};
-  [effects, reducers].forEach(item => {
+  const getLoading = {}
+  ;[effects, reducers].forEach((item) => {
-  const selectedApp = appList.length > 0 && appId
-    ? appList.find(item => appId === item.id.toString())
-    : undefined
+  const selectedApp =
+    appList.length > 0 && appId
+      ? appList.find((item) => appId === item.id.toString())
+      : undefined
-    if (
-      ch.toLowerCase() === 'a'
-      && substr(2)
-        .trim()
-        .toLowerCase() === 'as'
-    ) {
+    if (ch.toLowerCase() === 'a' && substr(2).trim().toLowerCase() === 'as') {
-    get label() { return i18n`dashboard` },
+    get label() {
+      return i18n`dashboard`
+    },

this is nice:

-    path: getFeatureConfig().useNewVizQuery ? '/socket/aeolus/v2' : '/socket.io',
+    path: getFeatureConfig().useNewVizQuery
+      ? '/socket/aeolus/v2'
+      : '/socket.io',

this is ok:

-  const el = node.nodeType === ELEMENT_NODE
-    ? node
-    : node.parentElement
+  const el = node.nodeType === ELEMENT_NODE ? node : node.parentElement
-    this.draggedSourceNodeRemovalObserver.observe(
-      node.parentElement,
-      { childList: true },
-    )
+    this.draggedSourceNodeRemovalObserver.observe(node.parentElement, {
+      childList: true,
+    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment