@dreamoment/catfish
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

catfish

Language: English | 中文简体

What is catfish ?

threejs garbage collector, free memory.

Any instance reference, such as browser extension, js console, will cause memory free failure.

Features

  • lightweight and easy to use

  • deep cleaning

  • supporttypescript

Install

npm i @dreamoment/catfish

Examples

import Catfish from '@dreamoment/catfish'

// Do not have redundant references to instances, or you will not be able to clean up successfully.
// console.log(object3D)

Catfish.dispose(object3D)

// If the variable is global, you must explicitly set the variable to null
object3D = null

// If you want to completely destroy the 3D application
// Catfish.exit(renderer)

API

static dispose

Free threejs instance memory.

Catfish.dispose(object: THREE.Object3D | THREE.BufferGeometry | THREE.Material | THREE.Texture): void

static exit

Destroy the threejs application. You should always call dispose before calling exit.

Catfish.exit(renderer: THREE.WebGLRenderer): void

Readme

Keywords

none

Package Sidebar

Install

npm i @dreamoment/catfish

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

567 kB

Total Files

8

Last publish

Collaborators

  • dreamoment-npm