(options)
| 3 | |
| 4 | export default class TreeStore { |
| 5 | constructor(options) { |
| 6 | this.currentNode = null; |
| 7 | this.currentNodeKey = null; |
| 8 | |
| 9 | for (let option in options) { |
| 10 | if (options.hasOwnProperty(option)) { |
| 11 | this[option] = options[option]; |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | this.nodesMap = {}; |
| 16 | |
| 17 | this.root = new Node({ |
| 18 | data: this.data, |
| 19 | store: this |
| 20 | }); |
| 21 | |
| 22 | if (this.lazy && this.load) { |
| 23 | const loadFn = this.load; |
| 24 | loadFn(this.root, (data) => { |
| 25 | this.root.doCreateChildren(data); |
| 26 | this._initDefaultCheckedNodes(); |
| 27 | }); |
| 28 | } else { |
| 29 | this._initDefaultCheckedNodes(); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | filter(value) { |
| 34 | const filterNodeMethod = this.filterNodeMethod; |
nothing calls this directly
no test coverage detected