Skip to content

Instantly share code, notes, and snippets.

import { useHistory } from 'react-router-dom'
import get from 'lodash/get'
const updatePath = (path, params) => {
if (!params)
return path
const regex = new RegExp(Object.keys(params).map(key => `:${key}`).join('|'), 'g')
return path.replace(regex, (matched) => params[matched.replace(':', '')])
}
import { useHistory } from 'react-router-dom'
import get from 'lodash/get'
const updatePath = (path, params) => {
if (!params)
return path
const regex = new RegExp(Object.keys(params).map(key => `:${key}`).join('|'), 'g')
return path.replace(regex, (matched) => params[matched.replace(':', '')])
}
import { useHistory } from 'react-router-dom'
const useNavigateTo = ({ path }) => {
const history = useHistory()
const navigateTo = () => history.push({
pathname: path
})
return navigateTo
{
"type": "topic",
"name": "topic-name",
"subscribers": [
{
"name": "topic-name-subscriber-one"
},
{
"name": "topic-name-subscriber-two"
}
{
"type": "topic",
"name": "topic-name",
"frequencyIntervalSeconds": 10,
"subscribers": [
{
"name": "topic-name-subscriber-one",
"url": "https://subscriberserviceone.azurewebsites.net/api/incomingMessage/topic-name"
},
{
public class LogicAppBootstrapper : IBootstrapSubscribers
{
private readonly SubscriberOptions _config;
private readonly IAzure _azure;
private readonly string _logicAppJsonTemplate;
public LogicAppBootstrapper(
IOptions<SubscriberOptions> config,
IAzure azure,
IFileReader fileReader)
public class ServiceBusBootstrapper : IBootstrapServiceBus
{
private readonly IDataProvider<Topic> _topicDataProvider;
private readonly ManagementClient _serviceBusClient;
public ServiceBusBootstrapper(IDataProvider<Topic> topicDataProvider,
ManagementClient serviceBusClient)
{
_topicDataProvider = topicDataProvider;
_serviceBusClient = serviceBusClient;
public class ServiceBusBootstrapper : IBootstrapServiceBus
{
private readonly IDataProvider<Topic> _topicDataProvider;
private readonly ManagementClient _serviceBusClient;
public ServiceBusBootstrapper(IDataProvider<Topic> topicDataProvider,
ManagementClient serviceBusClient)
{
_topicDataProvider = topicDataProvider;
_serviceBusClient = serviceBusClient;
"resources": [
{
"name": "[parameters('logicAppName')]",
"type": "Microsoft.Logic/workflows",
"location": "[parameters('logicAppLocation')]",
"tags": {
"displayName": "LogicApp"
},
"identity": {
"type": "UserAssigned",
"Condition": {
"actions": {
"Complete_the_message_in_a_topic_subscription": {
"runAfter": {},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['servicebus']['connectionId']"
}