Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
oninit: vnode => {
const tab = stream({});
Object.assign(vnode.state, {
tab,
redrawOnUpdate: stream.merge([tab]) // for React
});
},
view: vnode => {
oninit: vnode => {
const value = stream(attrs.defaultValue || attrs.value || 0);
Object.assign(vnode.state, {
value,
redrawOnUpdate: stream.merge([value]) // for React
});
},
view: vnode => {
oninit: vnode => {
const show = stream(false);
Object.assign(vnode.state, {
show,
redrawOnUpdate: stream.merge([show]) // for React
});
},
view: vnode => {
oninit: vnode => {
const show = stream(false);
Object.assign(vnode.state, {
show,
redrawOnUpdate: stream.merge([show]) // for React
});
},
view: vnode => {
oninit: vnode => {
const show = stream(false);
Object.assign(vnode.state, {
show,
redrawOnUpdate: stream.merge([show]) // for React
});
},
view: vnode => {
oninit: vnode => {
const show = stream(false);
const selectedIndex = stream(0);
Object.assign(vnode.state, {
show,
selectedIndex,
redrawOnUpdate: stream.merge([show]), // for React
id: "id-" + vnode.attrs.id || new Date().getTime() + Math.floor(Math.random() * 1000)
});
},
view: ({ state, attrs }) => {
} else if (e.key === "Enter") {
e.preventDefault();
selectedValue(matches()[index]);
} else if (e.key === "Escape" || e.key === "Esc") { // "Esc" for IE11
e.preventDefault();
selectedListIndex(-1);
}
};
Object.assign(vnode.state, {
handleKey,
selectedListIndex,
matches,
searchValue,
selectedValue,
redrawOnUpdate: stream.merge([searchValue, selectedListIndex]) // for React
});
},
view: vnode => {
const percentage = stream(0);
const step = timestamp => {
if (!start()) start(timestamp);
const progress = timestamp - start();
percentage(Math.min(1, 1.0 / STEP_DURATION * progress));
if (h.redraw) h.redraw(); // update Mithril
if (progress < STEP_DURATION) {
window.requestAnimationFrame(step);
}
};
Object.assign(vnode.state, {
start,
show,
step,
percentage,
redrawOnUpdate: stream.merge([show, start, percentage]) // update React
});
},
view: vnode => {
oninit: vnode => {
const checkedValue = stream(groupOptions.defaultCheckedValue || undefined);
vnode.state = {
checkedValue,
redrawOnUpdate: stream.merge([checkedValue])
};
},
view: vnode => {
import h from '../h';
import models from '../models';
import rewardVM from './reward-vm';
import projectGoalsVM from './project-goals-vm';
import userVM from './user-vm';
import Stream from 'mithril/stream';
import { ProjectDetails } from '../entities';
const currentProject = prop(),
userDetails = prop(),
subscriptionData = prop(),
projectContributions = prop([]),
vm = catarse.filtersVM({ project_id: 'eq' }),
idVM = h.idVM;
prop.merge([currentProject, userDetails, subscriptionData, projectContributions]).map(() => {
h.redraw();
});
const isSubscription = (project = currentProject) => {
if (_.isFunction(project)) {
return project() ? project().mode === 'sub' : false;
}
return project ? project.mode === 'sub' : false;
};
const fetchSubData = projectUuid => {
const lproject = commonAnalytics.loaderWithToken(models.projectSubscribersInfo.postOptions({ id: projectUuid }));
lproject.load().then(data => {
subscriptionData(