API > @blocksuite/blocks > getServiceOrRegister
Function: getServiceOrRegister ​
getServiceOrRegister<
Key
>(flavour
):BlockServiceInstanceByKey
<Key
> |Promise
<BlockServiceInstanceByKey
<Key
> >
Type parameters ​
Parameter |
---|
Key extends keyof BlockSchemas |
Parameters ​
Parameter | Type |
---|---|
flavour | Key |
Returns ​
BlockServiceInstanceByKey
< Key
> | Promise
< BlockServiceInstanceByKey
< Key
> >
Defined In ​
packages/blocks/src/_legacy/service/legacy-services/index.ts:60
getServiceOrRegister(
flavour
):BaseService
|Promise
<BaseService
>
Parameters ​
Parameter | Type |
---|---|
flavour | string |
Returns ​
BaseService
| Promise
< BaseService
>
Defined In ​
packages/blocks/src/_legacy/service/legacy-services/index.ts:63