Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'Loading' + Array(progress).fill('.').join('')
]);
}
function notAskedView() {
return dom_1.div([
'Search for something!'
]);
}
function postsView(posts) {
if (posts.length === 0) {
return dom_1.div('No results found');
}
return dom_1.div(posts.map(function (post) { return dom_1.div('.post', post.name + ' - ' + post.value); }));
}
var drivers = {
DOM: dom_1.makeDOMDriver(document.body),
RemoteData: src_1.makeRemoteDataDriver(),
Time: time_1.timeDriver
};
run_1.run(GithubSearch, drivers);
window.addEventListener('WebComponentsReady', () => {
(document as any).registerElement('many-item', { prototype: customElementify(Item as any) });
run(main, {
DOM: makeDOMDriver('#main-container')
});
});
type Sinks = {
DOM: Stream;
};
function main(sources: Sources): Sinks {
const vdom$ = sources.Time.periodic(1000).map(i => i + 1).startWith(0)
.map(i => <div>Seconds elapsed {i}</div>);
return {
DOM: vdom$,
};
}
run(main, {
DOM: makeDOMDriver('#main-container'),
Time: timeDriver
});
function main(sources) {
const history$ = sources.DOM.select('nav').events('click')
.map(e => e.target.dataset.page)
.compose(dropRepeats())
const vdom$ = view(sources.history);
return {
DOM: vdom$,
history: history$,
};
}
run(main, {
DOM: makeDOMDriver('#app'),
history: makeHashHistoryDriver()
});
p(errors.email),
]),
button("#submit.form-element", {type: "submit", disabled: !model}, "Register"),
hr(),
h2("State SPY"),
pre(JSON.stringify(state, null, 2)),
])
}
),
}
}
Cycle.run(main, {
state: identity,
DOM: makeDOMDriver("#app"),
})
li(['Option 1']),
li(['Option 2']),
li(['Option 3']),
li(['Option 4']),
li(['Option 5']),
li(['Option 6'])
])
);
return {
DOM: vdom$
};
}
run(main, {
DOM: makeDOMDriver('#app'),
drag: userSelectDriver
});
import {run} from '@cycle/run'
import {makeDOMDriver} from '@cycle/dom'
import onionify from 'cycle-onionify'
import Folder from './Folder'
const main = onionify(Folder)
run(main, {
DOM: makeDOMDriver('#app')
})
user === null ? null : div('.user-details', [
h1('.user-name', user.name),
h4('.user-email', user.email),
a('.user-website', {attrs: {href: user.website}}, user.website),
]),
]),
);
return {
DOM: vdom$,
HTTP: getRandomUser$,
};
}
run(main, {
DOM: makeDOMDriver('#main-container'),
HTTP: makeHTTPDriver(),
});
function modal({ DOM }: Sources): Sinks {
return {
DOM: observableOf(
div('.div', [
span('.span', ['This is an rxjs modal! :)']),
button('.button', ['close'])
])
),
modal: DOM.select('.button')
.events('click')
.pipe(mapTo({ type: 'close' } as ModalAction))
};
}
run(modalify(main), {
DOM: makeDOMDriver('#app')
});