mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-16 11:06:37 +00:00
23 lines
452 B
JavaScript
23 lines
452 B
JavaScript
'use strict';
|
|
|
|
const OpTypes = require('./OpTypes');
|
|
const OrbitDBItem = require('../post/OrbitDBItem');
|
|
const Post = require('../post/Post');
|
|
|
|
class Operation {
|
|
static create(ipfs, operation, key, value) {
|
|
const data = {
|
|
operation: operation,
|
|
key: key,
|
|
value: value
|
|
};
|
|
return Post.create(ipfs, Post.Types.OrbitDBItem, data);
|
|
}
|
|
|
|
static get Types() {
|
|
return OpTypes;
|
|
}
|
|
}
|
|
|
|
module.exports = Operation;
|