https://github.com/liplum/lateinit
https://github.com/liplum/lateinit
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/liplum/lateinit
- Owner: liplum
- Created: 2024-09-04T12:10:19.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-01-01T09:20:12.000Z (6 months ago)
- Last Synced: 2025-02-17T05:41:19.479Z (5 months ago)
- Language: TypeScript
- Size: 112 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lateinit
## Installation
```sh
yarn add @liplum/lateinit
# or
npm i @liplum/lateinit
# or
pnpm i @liplum/lateinit
```## Usage
### Basic usage
```js
import lateinit from "@liplum/lateinit"
let counter = 0
const a = lateinit(() => ++counter)
console.log()
t.assert(a() === 1)
t.assert(a() === 1)
```