Skip to content

Instantly share code, notes, and snippets.

View ha10id's full-sized avatar

Anthonio Achiduzu ha10id

  • Mars Weapons Inc.
View GitHub Profile

Factories

A factory is a function that returns a new reactive object.

  • Reactive Factories return reactive objects.
  • Resource Factories also return reactive objects, but they also register cleanup functions that are called when the object is no longer needed.

You can use a class as a factory, but it's not required. When you use a class as a factory, its constructor must take zero required arguments.