mirror of https://gitlab.com/ecentrics/breeze
Ezerous
4 years ago
7 changed files with 1822 additions and 662 deletions
@ -1,12 +1,6 @@ |
|||||
// All valid OrbitDB types
|
|
||||
export const ORBIT_TYPE_LOG = 'log'; |
|
||||
export const ORBIT_TYPE_FEED = 'feed'; |
|
||||
export const ORBIT_TYPE_KEYVALUE = 'keyvalue'; |
|
||||
export const ORBIT_TYPE_DOCS = 'docs'; |
|
||||
export const ORBIT_TYPE_COUNTER = 'counter'; |
|
||||
|
|
||||
// OrbitDB Databases status
|
// OrbitDB Databases status
|
||||
export const DB_STATUS_INIT = 'init'; |
export const DB_STATUS_INIT = 'init'; |
||||
export const DB_STATUS_READY = 'ready'; |
export const DB_STATUS_READY = 'ready'; |
||||
export const DB_STATUS_REPLICATING = 'replicating'; |
export const DB_STATUS_REPLICATING = 'replicating'; |
||||
export const DB_STATUS_REPLICATED = 'replicated'; |
export const DB_STATUS_REPLICATED = 'replicated'; |
||||
|
export const DB_STATUS_WRITTEN = 'written'; |
||||
|
@ -1,25 +0,0 @@ |
|||||
import * as orbitTypes from "./orbitConstants"; |
|
||||
|
|
||||
export function resolveOrbitDBTypeFun(orbitdb, type){ |
|
||||
let dbTypeFun; |
|
||||
switch(type) { |
|
||||
case orbitTypes.ORBIT_TYPE_LOG: |
|
||||
dbTypeFun = orbitdb.log; |
|
||||
break; |
|
||||
case orbitTypes.ORBIT_TYPE_FEED: |
|
||||
dbTypeFun = orbitdb.feed; |
|
||||
break; |
|
||||
case orbitTypes.ORBIT_TYPE_KEYVALUE: |
|
||||
dbTypeFun = orbitdb.keyvalue; |
|
||||
break; |
|
||||
case orbitTypes.ORBIT_TYPE_DOCS: |
|
||||
dbTypeFun = orbitdb.docs; |
|
||||
break; |
|
||||
case orbitTypes.ORBIT_TYPE_COUNTER: |
|
||||
dbTypeFun = orbitdb.counter; |
|
||||
break; |
|
||||
default: |
|
||||
throw "Invalid OrbitDB type!"; |
|
||||
} |
|
||||
return dbTypeFun; |
|
||||
} |
|
File diff suppressed because it is too large
Loading…
Reference in new issue