本文整理匯總了TypeScript中@feathersjs/feathers.ClientApp.configure方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ClientApp.configure方法的具體用法?TypeScript ClientApp.configure怎麽用?TypeScript ClientApp.configure使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@feathersjs/feathers.ClientApp
的用法示例。
在下文中一共展示了ClientApp.configure方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: return
return (app: ClientApp) => {
app
.configure(settingsEvents())
.configure(profileEvents())
.configure(usersEvents())
.configure(pickupQueuesEvents())
.configure(connectionEvents)
.configure(pickupPlayerEvents);
};
示例2: io
import io from 'socket.io-client';
import auth from '@feathersjs/authentication-client';
import events from './store/events';
const API_ENDPOINT = window.location.hostname === 'localhost'
? 'http://localhost:3000'
: 'https://api.tf2pickup.net';
const SOCKET_TIMEOUT = 2000;
const socket = io(API_ENDPOINT, {
path: '/ws/',
transports: ['websocket'],
reconnection: false,
timeout: SOCKET_TIMEOUT,
autoConnect: false,
});
const app: ClientApp = feathers();
app
.configure(socketio(socket, { timeout: SOCKET_TIMEOUT }))
.configure(auth({ storage: window.localStorage }))
.configure(events());
export {
API_ENDPOINT,
socket,
};
export default app;