This repository has been archived by the owner on Dec 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
> modified: es6/zil/index.js > renamed: es6/zil/Objects.js -> es6/zil/methodObjects.js > new file: es6/zil/propertyObjects.js > new file: lib/util/property.js > modified: lib/zil/index.js > renamed: lib/zil/Objects.js -> lib/zil/methodObjects.js > new file: lib/zil/propertyObjects.js > modified: package.json
- Loading branch information
CapCap_ghostcorn
authored and
CapCap_ghostcorn
committed
Aug 28, 2018
1 parent
217b0fb
commit 4617330
Showing
9 changed files
with
134 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
class Property { | ||
constructor(options) { | ||
const { name, getter, setter } = options | ||
this.name = name | ||
this.getter = getter | ||
this.setter = setter | ||
this.messanger = null | ||
} | ||
|
||
setMessanger = (msg) => { | ||
this.messanger = msg | ||
} | ||
|
||
propertyBuilder = () => { | ||
if (this.messanger !== null) { | ||
return (callback) => { | ||
if (callback) { | ||
return this.messanger.sendAsync({ method: this.getter }, callback) | ||
} | ||
return this.messanger.send({ method: this.getter }) | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default Property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default [ | ||
{ | ||
name: 'hashrate', | ||
getter: 'GetHashrate' | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); | ||
|
||
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); | ||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
|
||
var Property = function Property(options) { | ||
var _this = this; | ||
|
||
(0, _classCallCheck3.default)(this, Property); | ||
|
||
this.setMessanger = function (msg) { | ||
_this.messanger = msg; | ||
}; | ||
|
||
this.propertyBuilder = function () { | ||
if (_this.messanger !== null) { | ||
return function (callback) { | ||
if (callback) { | ||
return _this.messanger.sendAsync({ method: _this.getter }, callback); | ||
} | ||
return _this.messanger.send({ method: _this.getter }); | ||
}; | ||
} | ||
}; | ||
|
||
var name = options.name, | ||
getter = options.getter, | ||
setter = options.setter; | ||
|
||
this.name = name; | ||
this.getter = getter; | ||
this.setter = setter; | ||
this.messanger = null; | ||
}; | ||
|
||
exports.default = Property; | ||
module.exports = exports.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = [{ | ||
name: 'hashrate', | ||
getter: 'GetHashrate' | ||
}]; | ||
module.exports = exports.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters