2.1.0 • Published 2 years ago

@ontola/memoized-hash-factory v2.1.0

Weekly downloads
16
License
MIT
Repository
-
Last release
2 years ago

@ontola/memoized-hash-factory

RDFJS compatible data factory which implements memoization based on the term's hash. Once a term is created the same instance will be returned for future requests.

This saves memory and allows comparison by reference (===) which is great for browsers on mobile devices, but can cause out of memory exceptions for long running processes since the current implementation will always hold a strong reference to the created objects (I.e. they can't be garbage collected).

See @ontologies/core for more info on usage.

Usage

Put the following in a file;

/* useMemoizedHashFactory.js */
import singletonInstance from "@ontola/memoized-hash-factory";
import { setup } from "@ontologies/core";

setup(singletonInstance)

It is important to import the code which calls setup before importing any of the @ontologies/package helpers, since their exports use the factory which you pass to setup;

// This must be done first
import "./useMemoizedHashFactory"

// This import will use the factory you passed to `setup`.
import schema from "@ontologies/schema"
2.1.0

2 years ago

2.0.1

4 years ago

2.0.0

4 years ago

2.0.0-alpha.2

4 years ago

2.0.0-alpha.1

4 years ago

2.0.0-alpha.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago