本文整理汇总了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;未经允许,请勿转载。 |
请发表评论