metaRequests.ts 432 B
Newer Older
Andrei Eres's avatar
Andrei Eres committed
import { MetadataRequest } from '@polkadot/extension-base/background/types'
import { createStore } from 'nanostores'
Andrei Eres's avatar
Andrei Eres committed
import { subscribeMetadataRequests } from '../messaging/actions'
Andrei Eres's avatar
Andrei Eres committed

export const metaRequests = createStore<MetadataRequest[]>(() => {
  metaRequests.set([])
  subscribeMetadataRequests(setMetaRequests).catch(console.error)
})

export const setMetaRequests = (list: MetadataRequest[]) => {
  metaRequests.set(list)
}