當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript actions.createStickyAction函數代碼示例

本文整理匯總了TypeScript中state/actions.createStickyAction函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript createStickyAction函數的具體用法?TypeScript createStickyAction怎麽用?TypeScript createStickyAction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了createStickyAction函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('removes only the target sticky', () => {
   let state = stickiesReducers(undefined, createStickyAction({x: 10, y: 20, body: 'i am sticky', uuid: 'foo'}))
   const uuid = state.keySeq().first()
   state = stickiesReducers(state, createStickyAction({x: 10, y: 20, body: 'i am sticky 2', uuid: 'foo2'}))
   state = stickiesReducers(state, removeStickyAction({uuid}))
   expect(state.count()).to.eql(1)
 })
開發者ID:mlawrie,項目名稱:sticky-board,代碼行數:7,代碼來源:stickyReducers.test.ts

示例2: it

 it('sends request to POST /api/stickies', () => {
   dispatch(createStickyAction({x: 999, y: 123, body: 'foo', uuid: 'uuid'}))
   return waitForPromises().then(() => {
     expect(jsonRequestStub.firstCall.args[0].uri).to.eql('/api/stickies')
     expect(jsonRequestStub.firstCall.args[0].method).to.eql('POST')
   })
 })
開發者ID:mlawrie,項目名稱:sticky-board,代碼行數:7,代碼來源:sendActionToServer.test.ts

示例3: it

 it('calls service with createStickyAction', () => {
   const stub = sinon.stub().returns(Promise.resolve())
   injectMock(() => sendActionToServer, () => stub as any)
   dispatch(createStickyAction({x: 1, y: 2, body: 'some sticky', uuid: 'some uuid'}))
   expect(stub.firstCall.args[0].payload).to.eql({x: 1, y: 2, body: 'some sticky', uuid: 'some uuid'})
   expect(stub.firstCall.args[0].type).to.eql('CREATE_STICKY')
 })
開發者ID:mlawrie,項目名稱:sticky-board,代碼行數:7,代碼來源:persistenceMiddleware.test.ts

示例4: expect

 .then(() => {
   expect(getState().persistenceQueue.count()).to.eql(1)
   stub.returns(Promise.resolve())
   dispatch(createStickyAction({x: 1, y: 2, body: 'some other sticky', uuid: 'some uuid'}))
   expect(getState().persistenceQueue.count()).to.eql(2)
   stub.reset()
   stub.returns(Promise.resolve())
 })
開發者ID:mlawrie,項目名稱:sticky-board,代碼行數:8,代碼來源:persistenceMiddleware.test.ts


注:本文中的state/actions.createStickyAction函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。