Can someone please confirm whether I am right about event aggregation in PRISM 4?
Is it the case that you cannot subscribe for an event until the event has been published first or am I missing something?
No, you can subscribe to an event at any time, otherwise the subscriber would need intimate knowledge about the publisher, which would defeat the purpose of the mediator pattern.
Related
I think i am really thinking over the board. We are migrating form TFS to VSTS and we have an integration developed in c# that actually sends data from service now to TFS and TFS to ServiceNow. We have decided to use Event Grid to get the notifications from VSTS(Azure Dev Ops) when any work item got changed. Can somebody suggest if this possible and help on how to implement it if it is possible.
I don't believe you can directly get an event grid notification from Azure DevOps.
Instead setup a service hook to trigger when any work item gets changed. You can handle this in many different ways, but perhaps as an Azure Function (https://www.dotnetcurry.com/visualstudio/1341/service-hooks-vsts-azure-function) might be a good idea as it's serverless like Azure Event Grid.
You could then trigger a custom event into Azure Event Grid from your function if you already have code to work with topics in the grid. (e.g. http://www.biztalkgurus.com/blogs/msft-biztalk-community/sending-custom-events-to-azure-event-grid/).
"Marten does need to know what the event types are before you issue queries against the event data"
But I do for example
session.Events.FetchStream(streamId)
and
session.Events.Load<MembersJoined>()
and they works fine
thanks
I have found that, in practice, if your application commits events to Marten prior to reading any streams, you don't have to register any events.
If, however, you wind up reading streams prior to committing anything, you need to configure your events first. My application conditionally rebuilds projections on startup prior to accepting input, so it wound up causing this problem.
How to configure Marten for your events
When configuring Marten, pass in an IEnumerable<Type> of all your event types. For instance, my registration looks like this:
cfg.Events.AddEventTypes(
typeof(EventBase)
.Assembly
.GetTypes()
.Where(typeof(EventBase).IsAssignableFrom)
);
I recommend using a base class for all events as it makes things like this super simple.
Having configured Marten with those events, you are now free to query streams as you need to.
I'm using Slack API and want to detect an event when user first joins a team but cannot find such type of event in docs.
What should I look for?
I think team_join might be the event you're looking for? Depending on whether you need to respond immediately (and the consequences of missing an event if your bot is offline), you might also consider just calling users.list periodically and comparing to the list of already-seen users.
I see that there is only a limited amount of event types we can use in the Adobe DTM user interface . How can we use the above focus out and mutation observers to Capture user interactions?
The counterpart to "focus" is "blur", and it is available as an Event Type for Event Based Rules.
Mutation observers are not currently available in DTM, so you will need to write your own code for that. You can put it in a Page Load Rule as a Javascript / Third Party Tag, and have it trigger a Direct Call Rule.
I want to trigger an API call to fetch some supplemental data and display it alongside my react final form. What's the best way to do this?
I've started by using OnChange from react-final-form-listeners to listen for a field change and make an API call, but I don't really know how to store this data somewhere and display it within the react-final-form framework. Using a functional component and a State hook, it would be relatively trivial, because I would just set the state of a variable and then display it somewhere in the same component. Is this a sign that I should be storing these kinds of things in redux? Can I use hooks instead?
I forked one of the examples and added what I am trying to do:
https://codesandbox.io/embed/react-final-form-field-arrays-k9pqm
You're talking a little too abstractly about your goal here, but sure, you could keep the loaded data in state with a useState() hook. If I were you, I'd want to debounce it, and keep track of whether or not the Promise from your API call was the Promise from the last call or not.