@viewfly/core 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1808,7 +1808,7 @@ class RootComponent extends Component {
1808
1808
  }
1809
1809
 
1810
1810
  const viewflyErrorFn = makeError('Viewfly');
1811
- const VERSION = "0.2.4";
1811
+ const VERSION = "0.2.5";
1812
1812
  function viewfly(config) {
1813
1813
  const { context, nativeRenderer, autoUpdate, root } = Object.assign({ autoUpdate: true }, config);
1814
1814
  const appProviders = [];
@@ -1823,13 +1823,14 @@ function viewfly(config) {
1823
1823
  const render = createRenderer(rootComponent, nativeRenderer, VERSION);
1824
1824
  let isStarted = false;
1825
1825
  let task = null;
1826
- function microTask(callback) {
1827
- if (!task) {
1828
- task = Promise.resolve().then(() => {
1829
- task = null;
1830
- callback();
1831
- });
1826
+ function nextTick(callback) {
1827
+ if (task !== null) {
1828
+ return;
1832
1829
  }
1830
+ task = setTimeout(() => {
1831
+ task = null;
1832
+ callback();
1833
+ });
1833
1834
  }
1834
1835
  let appHost = null;
1835
1836
  const app = {
@@ -1875,7 +1876,7 @@ function viewfly(config) {
1875
1876
  render(host);
1876
1877
  };
1877
1878
  rootComponent.onChange = function () {
1878
- microTask(refresh);
1879
+ nextTick(refresh);
1879
1880
  };
1880
1881
  return app;
1881
1882
  },
package/bundles/index.js CHANGED
@@ -1810,7 +1810,7 @@ class RootComponent extends Component {
1810
1810
  }
1811
1811
 
1812
1812
  const viewflyErrorFn = makeError('Viewfly');
1813
- const VERSION = "0.2.4";
1813
+ const VERSION = "0.2.5";
1814
1814
  function viewfly(config) {
1815
1815
  const { context, nativeRenderer, autoUpdate, root } = Object.assign({ autoUpdate: true }, config);
1816
1816
  const appProviders = [];
@@ -1825,13 +1825,14 @@ function viewfly(config) {
1825
1825
  const render = createRenderer(rootComponent, nativeRenderer, VERSION);
1826
1826
  let isStarted = false;
1827
1827
  let task = null;
1828
- function microTask(callback) {
1829
- if (!task) {
1830
- task = Promise.resolve().then(() => {
1831
- task = null;
1832
- callback();
1833
- });
1828
+ function nextTick(callback) {
1829
+ if (task !== null) {
1830
+ return;
1834
1831
  }
1832
+ task = setTimeout(() => {
1833
+ task = null;
1834
+ callback();
1835
+ });
1835
1836
  }
1836
1837
  let appHost = null;
1837
1838
  const app = {
@@ -1877,7 +1878,7 @@ function viewfly(config) {
1877
1878
  render(host);
1878
1879
  };
1879
1880
  rootComponent.onChange = function () {
1880
- microTask(refresh);
1881
+ nextTick(refresh);
1881
1882
  };
1882
1883
  return app;
1883
1884
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/core",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Viewfly is a simple and easy-to-use JavaScript framework with an intuitive development experience.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",