Rename domain-tasks to domain-task

This commit is contained in:
SteveSandersonMS
2016-02-08 18:20:23 -08:00
parent 4312d6e28c
commit 32349fa85b
7 changed files with 11 additions and 11 deletions

View File

@@ -1,10 +1,10 @@
// TODO: Move this on to definitelytyped, and take a dependency on whatwg-fetch
// so that the 'fetch' function can have the correct type args
declare module 'domain-tasks' {
declare module 'domain-task' {
function addTask(task: PromiseLike<any>): void;
}
declare module 'domain-tasks/fetch' {
declare module 'domain-task/fetch' {
function fetch(url, options?): Promise<any>;
}

View File

@@ -1,7 +1,7 @@
require('./require-ts-babel')(); // Enable loading TS/TSX/JSX/ES2015 modules
var url = require('url');
var domainTasks = require('domain-tasks');
var baseUrl = require('domain-tasks/fetch').baseUrl;
var domainTask = require('domain-task');
var baseUrl = require('domain-task/fetch').baseUrl;
function render(bootModulePath, absoluteRequestUrl, requestPathAndQuery, callback) {
var bootFunc = require(bootModulePath);
@@ -19,11 +19,11 @@ function render(bootModulePath, absoluteRequestUrl, requestPathAndQuery, callbac
};
// Open a new domain that can track all the async tasks commenced during first render
domainTasks.run(function() {
domainTask.run(function() {
baseUrl(absoluteRequestUrl);
// Since route matching is asynchronous, add the rendering itself to the list of tasks we're awaiting
domainTasks.addTask(new Promise(function (resolve, reject) {
domainTask.addTask(new Promise(function (resolve, reject) {
// Now actually perform the first render that will match a route and commence associated tasks
bootFunc(params, function(error, result) {
if (error) {

View File

@@ -1,4 +1,4 @@
import { fetch } from 'domain-tasks/fetch';
import { fetch } from 'domain-task/fetch';
import { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
import { ActionCreator } from './';
import { Genre } from './GenreList';

View File

@@ -1,4 +1,4 @@
import { fetch } from 'domain-tasks/fetch';
import { fetch } from 'domain-task/fetch';
import { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
import { ActionCreator } from './';

View File

@@ -1,4 +1,4 @@
import { fetch } from 'domain-tasks/fetch';
import { fetch } from 'domain-task/fetch';
import { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
import { ActionCreator } from './';
import { Album } from './FeaturedAlbums';

View File

@@ -1,4 +1,4 @@
import { fetch } from 'domain-tasks/fetch';
import { fetch } from 'domain-task/fetch';
import { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
import { ActionCreator } from './';

View File

@@ -21,7 +21,7 @@
"dependencies": {
"bootstrap": "^3.3.6",
"domain-context": "^0.5.1",
"domain-tasks": "^1.0.0",
"domain-task": "^1.0.0",
"isomorphic-fetch": "^2.2.1",
"ntypescript": "^1.201602072208.1",
"react": "^0.14.7",