mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-22 17:47:53 +00:00
Rename domain-tasks to domain-task
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
// TODO: Move this on to definitelytyped, and take a dependency on whatwg-fetch
|
// TODO: Move this on to definitelytyped, and take a dependency on whatwg-fetch
|
||||||
// so that the 'fetch' function can have the correct type args
|
// 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;
|
function addTask(task: PromiseLike<any>): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module 'domain-tasks/fetch' {
|
declare module 'domain-task/fetch' {
|
||||||
function fetch(url, options?): Promise<any>;
|
function fetch(url, options?): Promise<any>;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
require('./require-ts-babel')(); // Enable loading TS/TSX/JSX/ES2015 modules
|
require('./require-ts-babel')(); // Enable loading TS/TSX/JSX/ES2015 modules
|
||||||
var url = require('url');
|
var url = require('url');
|
||||||
var domainTasks = require('domain-tasks');
|
var domainTask = require('domain-task');
|
||||||
var baseUrl = require('domain-tasks/fetch').baseUrl;
|
var baseUrl = require('domain-task/fetch').baseUrl;
|
||||||
|
|
||||||
function render(bootModulePath, absoluteRequestUrl, requestPathAndQuery, callback) {
|
function render(bootModulePath, absoluteRequestUrl, requestPathAndQuery, callback) {
|
||||||
var bootFunc = require(bootModulePath);
|
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
|
// Open a new domain that can track all the async tasks commenced during first render
|
||||||
domainTasks.run(function() {
|
domainTask.run(function() {
|
||||||
baseUrl(absoluteRequestUrl);
|
baseUrl(absoluteRequestUrl);
|
||||||
|
|
||||||
// Since route matching is asynchronous, add the rendering itself to the list of tasks we're awaiting
|
// 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
|
// Now actually perform the first render that will match a route and commence associated tasks
|
||||||
bootFunc(params, function(error, result) {
|
bootFunc(params, function(error, result) {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|||||||
@@ -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 { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
|
||||||
import { ActionCreator } from './';
|
import { ActionCreator } from './';
|
||||||
import { Genre } from './GenreList';
|
import { Genre } from './GenreList';
|
||||||
|
|||||||
@@ -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 { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
|
||||||
import { ActionCreator } from './';
|
import { ActionCreator } from './';
|
||||||
|
|
||||||
|
|||||||
@@ -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 { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
|
||||||
import { ActionCreator } from './';
|
import { ActionCreator } from './';
|
||||||
import { Album } from './FeaturedAlbums';
|
import { Album } from './FeaturedAlbums';
|
||||||
|
|||||||
@@ -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 { typeName, isActionType, Action, Reducer } from '../fx/TypedRedux';
|
||||||
import { ActionCreator } from './';
|
import { ActionCreator } from './';
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap": "^3.3.6",
|
"bootstrap": "^3.3.6",
|
||||||
"domain-context": "^0.5.1",
|
"domain-context": "^0.5.1",
|
||||||
"domain-tasks": "^1.0.0",
|
"domain-task": "^1.0.0",
|
||||||
"isomorphic-fetch": "^2.2.1",
|
"isomorphic-fetch": "^2.2.1",
|
||||||
"ntypescript": "^1.201602072208.1",
|
"ntypescript": "^1.201602072208.1",
|
||||||
"react": "^0.14.7",
|
"react": "^0.14.7",
|
||||||
|
|||||||
Reference in New Issue
Block a user