JSON-LD Context Routing
Strings and RegExp are exepted to test matching IRIs. A string routing is used, if the IRI starts with the given string. The test method is used in the RegExp case.
There are two classes for different use cases.
JSONify provides read and write access and uses Promises to handle the async Store API.
CachedJSONify should be used for objects which are expected to be accessed multiple times during a single request.
Calls for uncached objects receive the objects by the callback function.
Cached objects are passed using the function return value.
Frameworks like React or AngularJS benefit from the combined sync/async API to reduce the state changes.
A reduced number of state changes also minimizes the DOM updates to speed up the application.