• Robert Knight's avatar
    Use $q rather than native Promise in `store` · cac26947
    Robert Knight authored
    Testing code that mixes native promises with $q promises (eg. as
    returned by $http methods) is a PITA in tests because in that
    environment:
    
     1. Native promises behave as usual - resolving on the next tick
    
     2. $q promises do not resolve until a digest is triggered explicitly.
    
    As a result, causing a promise pipeline involving both types of promises
    to fully execute is tricky.
    
    Sticking to `$q` promises for the moment means that
    `$httpBackend.flush()` will synchronously flush any resolved promises
    and HTTP requests.
    
    In future we can replace this crap with plain fetch() as part of
    extracting the Hypothesis API client as a separate entity from the
    client.
    cac26947
Name
Last commit
Last update
.github Loading commit data...
docs Loading commit data...
images Loading commit data...
scripts Loading commit data...
src Loading commit data...
.eslintignore Loading commit data...
.eslintrc Loading commit data...
.gitignore Loading commit data...
.npmignore Loading commit data...
.npmrc Loading commit data...
.travis.yml Loading commit data...
CHANGELOG.md Loading commit data...
CODE_OF_CONDUCT Loading commit data...
Jenkinsfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
gulpfile.js Loading commit data...
npm-shrinkwrap.json Loading commit data...
package.json Loading commit data...