Skip to content

API > @blocksuite/blocks > getServiceOrRegister

Function: getServiceOrRegister ​

getServiceOrRegister<Key>(flavour): BlockServiceInstanceByKey< Key > | Promise< BlockServiceInstanceByKey< Key > >

Type parameters ​

Parameter
Key extends keyof BlockSchemas

Parameters ​

ParameterType
flavourKey

Returns ​

BlockServiceInstanceByKey< Key > | Promise< BlockServiceInstanceByKey< Key > >

Defined In ​

packages/blocks/src/_legacy/service/legacy-services/index.ts:60

getServiceOrRegister(flavour): BaseService | Promise< BaseService >

Parameters ​

ParameterType
flavourstring

Returns ​

BaseService | Promise< BaseService >

Defined In ​

packages/blocks/src/_legacy/service/legacy-services/index.ts:63