forked from external-repos/squoosh
Fix lint issues resulting from switching to airbnb (#94)
* Fix lint issues resulting from switching to airbnb. * Case sensitivity change * Fix lint script to actually lint tsx files
This commit is contained in:
committed by
Jake Archibald
parent
23ea9fad49
commit
835a537c55
@@ -25,6 +25,22 @@ export function bind(target: any, propertyKey: string, descriptor: PropertyDescr
|
||||
};
|
||||
}
|
||||
|
||||
/** Creates a function ref that assigns its value to a given property of an object.
|
||||
* @example
|
||||
* // element is stored as `this.foo` when rendered.
|
||||
* <div ref={linkRef(this, 'foo')} />
|
||||
*/
|
||||
export function linkRef<T>(obj: any, name: string) {
|
||||
const refName = `$$ref_${name}`;
|
||||
let ref = obj[refName];
|
||||
if (!ref) {
|
||||
ref = obj[refName] = (c: T) => {
|
||||
obj[name] = c;
|
||||
};
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns a given `ImageBitmap` into `ImageData`.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user