本文整理汇总了TypeScript中popmotion.value函数的典型用法代码示例。如果您正苦于以下问题:TypeScript value函数的具体用法?TypeScript value怎么用?TypeScript value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了value函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: value
const createPassiveValue = (
init: any,
parent: Value,
transform: Transformer
) => {
const raw = value(transform(init));
parent.raw.subscribe((v: any) => raw.update(transform(v)));
return { raw };
};
示例2: value
const createPassiveValue = (
init: any,
parent: Value,
transform: Transformer
) => {
const raw = value(init).pipe(transform);
parent.raw.subscribe(raw);
return { raw };
};
示例3: value
const setValue = ({ values, props }: PoserState, key: string, to: any) => {
if (values.has(key)) {
// Here, if we already have the value, we update it twice.
// Because of stylefire's render batching, this isn't going
// to actually render twice, but because we're making
// the value jump a great distance, we want to reset the velocity
// to 0, rather than something arbitrarily high
// A more explicit API would be nicer
const { raw } = values.get(key);
raw.update(to);
raw.update(to);
} else {
values.set(key, {
raw: value(to, (v: any) => props.elementStyler.set(key, v))
});
}
};
示例4: getValueType
const createValue = (init: any) => {
const type = getValueType(init);
const raw = value(init);
return { raw, type };
};