mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
11 lines
176 B
TypeScript
11 lines
176 B
TypeScript
import addLazyProperty = require('lazy-property');
|
|
|
|
const obj: { foo?: string } = {};
|
|
|
|
addLazyProperty(obj, 'foo', () => {
|
|
return 'bar';
|
|
});
|
|
|
|
// Access the property
|
|
obj.foo;
|