How to use the @cycle/dom.pre function in @cycle/dom

To help you get started, we’ve selected a few @cycle/dom 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 shesek / spark-wallet / client / src / views / expert.js View on Github external
const logs = ({ log, created_at }) => div([
  h2([ 'Log entries', ' ', button('.btn.btn-sm.btn-secondary.float-right', { attrs: { do: 'refresh-logs' } }, 'Refresh') ])
, pre('.logs.mt-3', code(log.map(i =>
    i.type === 'SKIPPED' ? `[SKIPPED] ${i.num_skipped}`
                         : `${i.time ? logTime(created_at, i.time) : ''} [${i.type}] ${i.source} ${i.log}`
  ).join('\n')))
])
github ivan-kleshnin / cyclejs-examples / 1.1-form / src / app.js View on Github external
DOM: state.map((state) => {
      return div([
        h1("Registration"),
        div(".form-element", [
          label({htmlFor: "username"}, "Username:"),
          br(),
          input("#username", {type: "text", autocomplete: "off"}),
        ]),
        div(".form-element", [
          label({htmlFor: "email"}, "Email:"),
          br(),
          input("#email", {type: "text", autocomplete: "off"}),
        ]),
        hr(),
        h2("State SPY"),
        pre(JSON.stringify(state, null, 2)),
      ])
    })
  }
github byteclubfr / copycast / client / components / Editor.js View on Github external
.map(([ [ , sel, contents, selRev ], editorHeaderVtree, markdownPreview ]) => {
		const content = selRev == null ? last(contents) : contents[selRev]

		return main('.main', [
			editorHeaderVtree,
			div('.editor', content
				? (markdownPreview && mime.lookup(sel) === 'text/markdown'
					? div(markdown(content))
					: pre(code('.editor-code.hljs', hl(content)))
				)
				: div('.editor-no-content', '⇐ Select a file on the left'))
		])
	})
github ivan-kleshnin / cyclejs-examples / 1.5-form.alt / src / app.js View on Github external
div(".form-element", [
          label({htmlFor: "username"}, "Username:"),
          br(),
          input("#username", {type: "text", value: state.form.input.username, autocomplete: "off"}),
          p(state.form.errors.username),
        ]),
        div(".form-element", [
          label({htmlFor: "email"}, "Email:"),
          br(),
          input("#email", {type: "text", value: state.form.input.email, autocomplete: "off"}),
          p(state.form.errors.email),
        ]),
        button("#register.form-element", {type: "submit", disabled: !state.form.output}, "Register"),
        hr(),
        h2("State SPY"),
        pre(JSON.stringify(state, null, 2)),
      ])
    }),
    state: stateSink,
github ivan-kleshnin / cyclejs-examples / 1.4-form / src / app.js View on Github external
return div([
          h1("Registration"),
          div(".form-element", [
            label({htmlFor: "username"}, "Username:"),
            br(),
            input("#username", {type: "text", value: form.username, autocomplete: "off"}),
          ]),
          div(".form-element", [
            label({htmlFor: "email"}, "Email:"),
            br(),
            input("#email", {type: "text", value: form.email, autocomplete: "off"}),
          ]),
          button("#submit.form-element", {type: "submit", disabled: !model}, "Register"),
          hr(),
          h2("State SPY"),
          pre(JSON.stringify(state, null, 2)),
        ])
      }
    ),
github shesek / spark-wallet / client / views.js View on Github external
const logs = items => div([
  h2([ 'Log entries ', button('.btn.btn-sm.btn-secondary', { attrs: { do: 'refresh-logs' } }, 'Refresh') ])
, pre('.logs.mt-3', code(items.map(i =>
    i.type === 'SKIPPED' ? `[SKIPPED] ${i.num_skipped}`
                         : `${i.time} [${i.type}] ${i.source} ${i.log}`
  ).join('\n')))
])
github soyuka / dpicker / docs / demo / src / app.js View on Github external
div('.row.form-group', [
          div('.col-md-12', [
            p('.alert.alert-warning', [
              'Type ',
              kbd('+'),
              ' to jump to today\'s date. ',
              kbd('+100'),
              ' will return today + 100 days. ',
              kbd('-100'),
              ' does the opposite'
            ])
          ])
        ]),
        h2('Configuration: '),
        div('.row', div('.col-md-12', [
          pre(code(JSON.stringify(data, null, 2)))
        ]))
      )

      return div('.row', div('.col-md-12', childNodes))
    })
github shesek / spark-wallet / client / src / views / util.js View on Github external
export const yaml = data => pre('.mt-3.text-left.text-muted', typeof data == 'string' ? data : YAML.safeDump(data))