Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@promises/reset

yisraelx10MIT0.5.0TypeScript support: included

Reset is package from Promises library

promise, promises, utilities, utility, utils, modules, modular, async, await, deferred

readme

@promises/reset

Source Code Version MIT License Bundle Size

Reset is package from Promises library

Use

Module

$ npm install --save @promises/reset
import {
 default as reset
} from '@promises/reset';

Browser

<script src="https://unpkg.com/@promises/reset/bundle.umd.min.js"></script>
let {
 reset
} = P;

Examples

 let promise: Promise<string> = Promise.resolve<string>('foo');

 reset(promise, 'bar').then((result: string) => {
   console.log(result); // => 'bar'
 });
 let promise: Promise<string> = Promise.reject<string>('foo');

 reset(promise, 'bar').then((result: string) => {
   console.log(result); // => 'bar'
 });

Functional programming

Module

$ npm install --save @promises/reset
import {
 __,
 default as reset
} from '@promises/reset/fp';

Browser

<script src="https://unpkg.com/@promises/reset/fp/bundle.umd.min.js"></script>
let {
 __,
 reset
} = PF;

Examples

 let promise: Promise<string> = Promise.resolve<string>('foo');

 reset('bar')(promise).then((result: string) => {
   console.log(result); // => 'bar'
 });
 let promise: Promise<string> = Promise.reject<string>('foo');

 reset('bar', promise).then((result: string) => {
   console.log(result); // => 'bar'
 });

Wrapper

Module

$ npm install --save @promises/reset
import Promises from '@promises/core';
import '@promises/reset/add';

Or

import Promises from '@promises/reset/add';

Browser

<script src="https://unpkg.com/@promises/core/bundle.umd.min.js"></script>
<script src="https://unpkg.com/@promises/reset/add/bundle.umd.min.js"></script>
let {
 Promises
} = P;

Examples

 let promises: Promises<string> = Promises.resolve<string>('foo').reset('bar');
 promises.then((result: string) => {
   console.log(result); // => 'bar'
 });,

 let promises: Promises<string> = Promises.reject<string>('foo').reset('bar');
 promises.then((result: string) => {
   console.log(result); // => 'bar'
 });

Compatibility

These modules are written in typescript and available in ES5 and ES6 standard, the requirements are a global Promise (native or polyfill).

License

Copyright © 2017 Yisrael Eliav, Licensed under the MIT license.

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.5.0 (2018-07-16)

Bug Fixes

  • interfaces: ordering, error with objects, and rename fp interfaces (fc28328)

build

  • move from webpack to rollup, compatibility changes (47594dc)

Code Refactoring

  • separates add and export, adds 'add' file to groups packages (be1e7f6)

Features

  • fp: convert fp to sub-package, and add fp to all group packages (94bebb3)
  • fp: move to conversion by @pakal/curry, add placeholder support (ff18d23)
  • add Tree-Shaking & esm support and convert "add" to sub-package (0aa2297)

BREAKING CHANGES

  • change in wrapper use, for use in wrapper:
    import Promises from '@promises/-all/add';
    Or
    import Promises from '@promises/core';
    import '@promises/-all/add';
  • fp: remove "@promises/-fp" package, use "@promises/-all/fp" sub-package instead.
  • new compatibility support:
  • main - commonjs module and es5 standard (index.js)
  • es2015 - commonjs module and es2015 standard (index.es6.js)
  • browser - bundle in umd format includes all scope dependencies in es5 standard (bundle.umd.js, bundle.umd.min.js)
  • typings - typescript declaration file (index.d.ts)
  • "add" does not export the "index" export, it only adds to Promises
    import Promises from '@promises/core';
    import '@promises/for-each-series/add';

0.4.0 (2018-03-17)

Features

  • Adding Functional programming support (c801b97)

0.3.1 (2018-03-05)

Note: Version bump only for package @promises/reset

0.3.0 (2018-03-05)

Chores

  • package: change of the export properties (main, browser, module, es2015) (5a146dc)

Code Refactoring

  • all interfaces that did not start with the letter 'I' were fixed and now they start with ' (8c8de27)

Features

  • change packages architecture and giving independence to modules/methods (832216b)

BREAKING CHANGES

  • standalone methods return 'Promise' instead of 'Promises'

before

import method from '@promises/method';
let promises: Promises<any> = method<any>();

after

import method from '@promises/method';
let promise: Promise<any> = method<any>();

for Promises use Promises

import Promises from '@promises/-all';

let promises: Promises<any> = Promises.method<any>();

changing the architecture of loading methods to 'Promises'

before

import Promises from '@promises/core';
import method from '@promises/method';

method()
Promise.method()
import Promises from '@promises/core';
import '@promises/method';

Promise.method()

after

import
Promises from '@promises/core';
import method from '@promises/method';

method()
Promise.method() // throw Error
import Promises from '@promises/core';
import method from'@promises/method/add';

method()
Promise.method()
  • package: change properties:
  • main: umd.js => es5.js
  • browser: umd.js => umd.min.js
  • module: es5.js => index.js
  • bundle: bundle.js => bundle.min.js
  • rename all interfaces that did not start with the letter 'I'

0.2.0 (2017-09-20)

Code Refactoring

  • reset: change purpose for handling in both resolve and reject (ac2f9ae)

BREAKING CHANGES

  • reset: The method now handles both resolve and reject, compared with its previous version, which only dealt with resolve.

0.1.0 (2017-06-24)

Features