Factory function type for creating backend instances.
Backends receive StateAndStore which contains the current state and optional store, extracted from the execution context.
BackendFactory: (stateAndStore: StateAndStore) => BackendProtocol// Using in middleware
const middleware = createFilesystemMiddleware({
backend: (stateAndStore) => new StateBackend(stateAndStore)
});