本文整理汇总了TypeScript中react-redux-toastr.toastr.confirm方法的典型用法代码示例。如果您正苦于以下问题:TypeScript toastr.confirm方法的具体用法?TypeScript toastr.confirm怎么用?TypeScript toastr.confirm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类react-redux-toastr.toastr
的用法示例。
在下文中一共展示了toastr.confirm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Promise
return new Promise((resolve, reject) => {
const {Owned} = contracts
const toastrConfirmOptions = {
onOk: () => {
resolve(Owned.changeOwner
.sendTransaction(newOwnerAddress, {from: ownerAddress, gas: 200000})) // todo check gas
},
onCancel: () => console.log('Ownership transfer cancelled')
}
toastr.confirm(`Are you sure that you want to transfer ownership to ${newOwnerAddress}`, toastrConfirmOptions)
})
示例2: test
function test() {
const store = createStore(combineReducers({ toastr: toastrReducer }));
var toastrFactory = React.createFactory(ReduxToastr);
var element = toastrFactory({ timeOut: 1000, newestOnTop: false });
var providerFactory = React.createFactory(Provider);
var root = providerFactory({ store: store }, element);
function callback() { }
toastr.clean();
toastr.confirm("Test", { onOk: callback, onCancel: callback });
toastr.error("Error", "Error message");
toastr.info("Info", "Info test", { timeOut: 1000, removeOnHover: true, onShowComplete: callback });
toastr.success("Test", "Test message", { component: new React.Component({}) });
}