本文整理匯總了TypeScript中maquette.createProjector函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript createProjector函數的具體用法?TypeScript createProjector怎麽用?TypeScript createProjector使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了createProjector函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: fetchData
let initialize = () => {
projector = maquette.createProjector()
fetchData().then((response) => {
document.body.innerHTML = '';
createLevelSectionComponents(response.data)
projector.append(document.body, renderMaquette)
});
teamToggleComponent = createTeamToggleComponent(projector, { getActiveTeam: getActiveTeam, setActiveTeam: setActiveTeam })
}
示例2: createProjector
import {createProjector} from 'maquette';
import {renderMaquette} from './app';
createProjector({}).append(document.body, renderMaquette);
示例3: createProjector
///<reference path='../../typings/es6-promise/es6-promise.d.ts' />
///<reference path='../../typings/whatwg-fetch/whatwg-fetch.d.ts' />
import {createProjector} from 'maquette';
import {createPlanningApplication} from './app';
(window as any).require('whatwg-fetch');
let projector = createProjector({});
let app = createPlanningApplication(projector);
projector.append(document.body, app.renderMaquette);
示例4: constructor
constructor() {
this.projector = createProjector();
}
示例5: createProjector
import 'es6-shim';
import { createProjector } from 'maquette';
import store from './store';
import app from './components/app';
import history from './history';
import navigate from './actions/navigate';
const projector = createProjector({});
/**
* Whenever the store changes as the result of an action
* tell Maquette to schedule another render of the virtual
* DOM.
*/
store.subscribe(function () {
projector.scheduleRender();
});
/**
* Define the projector that will render the virtual DOM
* and update the real DOM. We will simply append the app
* to the <body>.
*/
projector.append(document.body, function () {
return app(store.getState());
});
/**
* Listen for history events and dispatch a new action to
* the store to handle the new location.
*/