We need various formats to support every environment
- ES5
- AMD
- CommonJS
- UMD
- ES2015
| beforeEach(async(() => { | |
| TestBed.configureTestingModule({ | |
| imports: [ | |
| MdToolbarModule, | |
| ], | |
| providers: [ | |
| { | |
| provide: Router, | |
| useClass: MockRouter, | |
| }, |
| // This worker resolves typings (.d.ts files) for the given list of dependencies. | |
| self.importScripts([ | |
| 'https://cdnjs.cloudflare.com/ajax/libs/typescript/2.8.3/typescript.min.js' | |
| ]); | |
| //const PACKAGES_SOURCE = 'https://unpkg.com'; | |
| const PACKAGES_SOURCE = 'https://cdn.jsdelivr.net/npm' | |
| const resolved = {}; |
| import { Resolver, NpmHttpRegistry } from '@stackblitz/turbo-resolver'; | |
| function resolve(dependencies){ | |
| const resolver = new Resolver(); | |
| return resolver.resolve(dependencies); | |
| } | |
| resolve({ | |
| "rxjs": "https://github.com/reactivex/rxjs", // Master branch of Rx.js repo | |
| "left-pad": "*", |
Some things that are "better" with this BetterPromise implementation:
BetterPromise # unthen(..) / BetterPromise # uncatch(..) / BetterPromise # unfinally(..) allows you to unregister a fulfillment or rejection handler that you previously registered on a promise via then(..) or catch(..), or unregister a resolution handler that you previously registered on a promise via finally(..).
NOTE: This seems to be the majority use-case for why many like/want "promise cancelation" -- IOW, often what you want is to just stop observing a promise's resolution, not actually forcibly cancel the operation is comes from.
var p = new BetterPromise(function(res){
setTimeout(function(){ res(42); },100);
});| // | |
| // ViewController.m | |
| // app-with-jscontext | |
| // | |
| // Created by DE505 on 21/05/2018. | |
| // Copyright © 2018 DE505. All rights reserved. | |
| // | |
| #import "ViewController.h" |
| // Teste Unitário de FormBuilder | |
| import { Component } from '@angular/core'; | |
| import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; | |
| import { async, TestBed } from '@angular/core/testing'; | |
| describe('FormBuilder', () => { | |
| /* @Component({ |
| ... | |
| ngAfterViewInit() { | |
| document.getElementById('loadingIndicator').style.display = 'none'; | |
| } |
| node_modules |
| import io.vertx.core.json.JsonArray; | |
| import rx.Observable; | |
| import rx.Single; | |
| /** | |
| * @author abner2 | |
| */ | |
| public class RxPlayground { | |
| public static void main(String[] args) { |