How to use the subx.create function in subx

To help you get started, we’ve selected a few subx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github electerm / electerm / src / client / store / index.js View on Github external
} else if (tab === settingMap.quickCommands) {
    return {
      id: '',
      name: q(newQuickCommand)
    }
  }
}

const tabs = [newTerm()]
const bookmarks = copy(ls.get(settingMap.bookmarks) || [])
const bookmarkGroups = copy(
  ls.get(settingMap.bookmarkGroups) ||
  getDefaultBookmarkGroups(bookmarks)
)

const store = Subx.create({
  tabs,
  height: 500,
  width: window.innerWidth - sidebarWidth,
  currentTabId: tabs[0].id,
  history: copy(ls.get(settingMap.history) || []),
  quickCommands: copy(ls.get(settingMap.quickCommands) || []),
  quickCommandId: '',
  bookmarks,
  bookmarkGroups,
  setting: [
    {
      id: 'setting-sync',
      title: ss('settingSync')
    }
  ],
  sshConfigItems: copy(getGlobal('sshConfigItems')),

subx

SubX, Next generation state container

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis