TinyBase logoTinyBase

destroy

The destroy method should be called when this Middleware object is no longer used. It removes all hooks and listeners from the Store, and unregisters the Middleware from the Store.

destroy(): void

Example

This example creates a Middleware object against a newly-created Store and then destroys it.

import {createMiddleware, createStore} from 'tinybase';

const store = createStore();
const middleware = createMiddleware(store);
middleware.destroy();

Since

v8.0.0