mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 04:01:52 +00:00
Add tests for new call route type definition
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import falcor = require('falcor');
|
||||
import Router = require('falcor-router');
|
||||
import falcorJsonGraph = require('falcor-json-graph');
|
||||
|
||||
new Router([]);
|
||||
new Router([], {});
|
||||
@@ -100,3 +101,76 @@ new Router([{
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.new',
|
||||
call(callpath, args) {
|
||||
return {path: 'json.todosById.1234.name', value: 'Buy cheese'};
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.new',
|
||||
call(callpath, args) {
|
||||
return falcorJsonGraph.pathInvalidation('json.todos.length');
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.new',
|
||||
call(callpath, args) {
|
||||
return [
|
||||
falcorJsonGraph.pathInvalidation('json.todos.length'),
|
||||
{path: 'json.todosById.1234.name', value: 'Buy cheese'}
|
||||
]
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.new',
|
||||
call(callpath, args) {
|
||||
return new Promise((resolve, reject): void => {
|
||||
resolve([
|
||||
falcorJsonGraph.pathInvalidation('json.todos.length'),
|
||||
{path: 'json.todosById.1234.name', value: 'Buy cheese'}
|
||||
]);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.new',
|
||||
call(callpath, args) {
|
||||
return {
|
||||
paths: [['json', 'todosById', '1234', 'name']],
|
||||
jsonGraph: {
|
||||
json: {
|
||||
todosById: {
|
||||
1234: {
|
||||
name: 'Buy cheese'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}]);
|
||||
|
||||
new Router([{
|
||||
route: 'todos.new',
|
||||
call(callpath, args) {
|
||||
return new Promise((resolve, reject): void => {
|
||||
resolve({
|
||||
paths: [['json', 'todosById', '1234', 'name']],
|
||||
jsonGraph: {
|
||||
json: {
|
||||
todosById: {
|
||||
1234: {
|
||||
name: 'Buy cheese'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for falcor-router 0.4.0
|
||||
// Project: https://github.com/Netflix/falcor-router
|
||||
// Definitions by: Quramy <https://github.com/Quramy/>
|
||||
// Definitions by: Quramy <https://github.com/Quramy/> and cdhgee <https://github.com/cdhgee/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference types="falcor" />
|
||||
|
||||
Reference in New Issue
Block a user