Skip to content

Releases: Lemoncode/react-promise-tracker

v2.1.1

04 Nov 12:06
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 2.1.0...v2.1.1

v2.1.1-beta.0

04 Nov 08:40
Compare
Choose a tag to compare
v2.1.1-beta.0 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: 2.1.0...v2.1.1-beta.0

v2.1.0

02 Mar 13:34
Compare
Choose a tag to compare

New Features

  • Implement manually endpoints. #81
    • function manuallyResetPromiseCounter(area?: string): void;
    • function manuallyDecrementPromiseCounter(area?: string): void;
    • function manuallyIncrementPromiseCounter(area?: string): void

v2.0.6

22 Feb 09:42
Compare
Choose a tag to compare

Fix

  • Fix emitter cancellation when there are many spinners. PR #79

v2.0.5

12 Aug 07:37
Compare
Choose a tag to compare

Fix

  • Fix useEffect to accept an array instead of an object. PR #72

v2.0.4

24 Jul 18:48
0b77230
Compare
Choose a tag to compare

Fix

2.0.3 Relase

15 May 10:33
662eb26
Compare
Choose a tag to compare

Fixed typings added new examples.

2.0.0 Release

16 Apr 09:41
Compare
Choose a tag to compare

react-promise-tracker version 2 adds tracker Hooks API implementation.

How to use it?

    
import React from "react";
+ import { usePromiseTracker } from "react-promise-tracker";
import Loader from "react-loader-spinner";
import "./spinner.css";

export const Spinner = (props) => {
+  const { promiseInProgress } = usePromiseTracker();

  return (
+   promiseInProgress && (
      <div className="spinner">
        <Loader type="ThreeDots" color="#2BAD60" height="100" width="100" />
      </div>
    )
  );
};
  • We add examples folder in ./examples.

Breaking changes

  • Replace area property by config to provide a config object. Example:
import React, { Component } from 'react';
import { render } from 'react-dom';
import { App } from './app';
import { Spinner } from './common/components/spinner';

render(
  <div>
    <App />
-   <Spinner area="test-area" />
+   <Spinner config={ { area: "test-area" } } />
  </div>,
  document.getElementById('root'));

Changes

  • Added delay property to resolve promise after feeded delay. A use case, for example, when we have a high speed connection, we don't want to show the spinner if promise was resolved too fast.

  • Hook example:

import React from "react";
import { usePromiseTracker } from "react-promise-tracker";
import Loader from "react-loader-spinner";
import "./spinner.css";

export const Spinner = (props) => {
- const { promiseInProgress } = usePromiseTracker();
+ const { promiseInProgress } = usePromiseTracker({delay: 200});

  return (
    promiseInProgress && (
      <div className="spinner">
        <Loader type="ThreeDots" color="#2BAD60" height="100" width="100" />
      </div>
    )
  );
};
  • HOC example:
import React, { Component } from 'react';
import { render } from 'react-dom';
import { App } from './app';
import { Spinner } from './common/components/spinner';

render(
  <div>
    <App />
-   <Spinner />
+   <Spinner config={ { delay: 200 } } />
  </div>,
  document.getElementById('root'));

v2.0.0-beta.1

08 Apr 08:07
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release

react-promise-tracker version 2 adds tracker Hooks API implementation.

How to use it?

    
import React from "react";
+ import { usePromiseTracker } from "react-promise-tracker";
import Loader from "react-loader-spinner";
import "./spinner.css";

export const Spinner = (props) => {
+  const { promiseInProgress } = usePromiseTracker();

  return (
+   promiseInProgress && (
      <div className="spinner">
        <Loader type="ThreeDots" color="#2BAD60" height="100" width="100" />
      </div>
    )
  );
};
  • We add examples folder in ./examples.

Breaking changes

  • Replace area property by config to provide a config object. Example:
import React, { Component } from 'react';
import { render } from 'react-dom';
import { App } from './app';
import { Spinner } from './common/components/spinner';

render(
  <div>
    <App />
-   <Spinner area="test-area" />
+   <Spinner config={ { area: "test-area" } } />
  </div>,
  document.getElementById('root'));

Changes

  • Added delay property to resolve promise after feeded delay. A use case, for example, when we have a high speed connection, we don't want to show the spinner if promise was resolved too fast.

  • Hook example:

import React from "react";
import { usePromiseTracker } from "react-promise-tracker";
import Loader from "react-loader-spinner";
import "./spinner.css";

export const Spinner = (props) => {
- const { promiseInProgress } = usePromiseTracker();
+ const { promiseInProgress } = usePromiseTracker({delay: 200});

  return (
    promiseInProgress && (
      <div className="spinner">
        <Loader type="ThreeDots" color="#2BAD60" height="100" width="100" />
      </div>
    )
  );
};
  • HOC example:
import React, { Component } from 'react';
import { render } from 'react-dom';
import { App } from './app';
import { Spinner } from './common/components/spinner';

render(
  <div>
    <App />
-   <Spinner />
+   <Spinner config={ { delay: 200 } } />
  </div>,
  document.getElementById('root'));

v1.1.1

20 Sep 11:09
Compare
Choose a tag to compare

#Fixes

  • Fixed race condition between HOC mount and counter state #40. Some Specs #1 #2