diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-11-13 08:16:12 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-11-13 08:16:52 +0100 |
commit | b2128609ac8159a14224deba399144b3400c8c20 (patch) | |
tree | 4759dfda67c54f6838c3aef0951545ae18bb83bd /thirdparty/preact/src/vdom/component-recycler.js | |
parent | 3f0ee289c4a61991d0e75906a9bd949cebb39d20 (diff) | |
download | wallet-core-b2128609ac8159a14224deba399144b3400c8c20.tar.xz |
Finally give in and use React, minor tweeks.
Preact (a minimalistic React alternative) had too many bugs ...
Diffstat (limited to 'thirdparty/preact/src/vdom/component-recycler.js')
-rw-r--r-- | thirdparty/preact/src/vdom/component-recycler.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/thirdparty/preact/src/vdom/component-recycler.js b/thirdparty/preact/src/vdom/component-recycler.js deleted file mode 100644 index a70f0ece0..000000000 --- a/thirdparty/preact/src/vdom/component-recycler.js +++ /dev/null @@ -1,32 +0,0 @@ -import { Component } from '../component'; - -/** Retains a pool of Components for re-use, keyed on component name. - * Note: since component names are not unique or even necessarily available, these are primarily a form of sharding. - * @private - */ -const components = {}; - - -export function collectComponent(component) { - let name = component.constructor.name, - list = components[name]; - if (list) list.push(component); - else components[name] = [component]; -} - - -export function createComponent(Ctor, props, context) { - let inst = new Ctor(props, context), - list = components[Ctor.name]; - Component.call(inst, props, context); - if (list) { - for (let i=list.length; i--; ) { - if (list[i].constructor===Ctor) { - inst.nextBase = list[i].nextBase; - list.splice(i, 1); - break; - } - } - } - return inst; -} |