How to use the defaults/generator.getProps function in defaults

To help you get started, we’ve selected a few defaults 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 swiftyapp / swifty / src / renderer / javascripts / components / main / sidebar / settings / password.js View on Github external
const Password = ({ section }) => {
  const [options, setOptions] = useState(getProps())
  const [example, setExample] = useState(generatePassword(getProps()))

  const onChange = event => {
    const option = {}
    option[event.target.name] = event.target.checked
    updateOption(option)
  }

  const onValueChange = event => {
    const option = {}
    option[event.target.name] = event.target.value
    updateOption(option)
  }

  const updateOption = option => {
    const upadtedOptions = { ...options, ...option }
    setExample(generatePassword(upadtedOptions))
github swiftyapp / swifty / src / renderer / javascripts / components / main / body / aside / form / login.js View on Github external
const generatePassword = () => {
    const password = window.generatePassword(getProps())
    onChange({ target: { name: 'password', value: password } })
  }
github swiftyapp / swifty / src / renderer / javascripts / components / main / sidebar / settings / password.js View on Github external
const Password = ({ section }) => {
  const [options, setOptions] = useState(getProps())
  const [example, setExample] = useState(generatePassword(getProps()))

  const onChange = event => {
    const option = {}
    option[event.target.name] = event.target.checked
    updateOption(option)
  }

  const onValueChange = event => {
    const option = {}
    option[event.target.name] = event.target.value
    updateOption(option)
  }

  const updateOption = option => {
    const upadtedOptions = { ...options, ...option }