+12
-24
@@ -18,7 +18,17 @@ class Cell { | ||
| _render() { | ||
| // impl | ||
| return this | ||
| } | ||
| render(opts = {}) { | ||
| const cell = this._render() | ||
| if (!cell.cellery) { | ||
| cell.register(this.cellery) | ||
| } | ||
| this.cellery.pub({ | ||
| event: 'render', | ||
| id: this.id, | ||
| content: this.cellery.adapter.render(this), | ||
| id: cell.id, | ||
| content: this.cellery.adapter.render(cell), | ||
| ...opts | ||
@@ -44,23 +54,2 @@ }) | ||
| class MultiCell { | ||
| constructor(opts = {}) { | ||
| this.id = opts.id | ||
| this.cellery = opts.cellery | ||
| } | ||
| sub(pattern, cb) { | ||
| this.cellery.sub(pattern).on('data', (d) => cb(this, d)) | ||
| } | ||
| _render() { | ||
| // impl | ||
| } | ||
| render(opts = {}) { | ||
| const cell = this._render() | ||
| cell.register(this.cellery) | ||
| cell.render(opts) | ||
| } | ||
| } | ||
| class Container extends Cell { | ||
@@ -112,3 +101,2 @@ // TODO: replace with classes | ||
| Cell, | ||
| MultiCell, | ||
| Container, | ||
@@ -115,0 +103,0 @@ App, |
+1
-1
| { | ||
| "name": "cellery", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "description": "cellery", | ||
@@ -5,0 +5,0 @@ "exports": { |
+1
-1
@@ -53,3 +53,3 @@ # Cellery | ||
| | Cell | Description | | ||
| |-------------|------------------------------------------| | ||
| | ----------- | ---------------------------------------- | | ||
| | `Cell` | Base class for all components | | ||
@@ -56,0 +56,0 @@ | `MultiCell` | Composes multiple cells into one render | |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
-100%20805
-0.98%245
-3.92%