How to use Flux emitter and events with .net MVC?

I am trying to learn the Flux pattern.

I learned how to use React with .net MVC and displayed it on the server side.

I would like to learn Flux, but all tutorials use node js.

I do not use node.

I do not know how to implement the Event Emitter part, because it uses the node function.

https://www.codementor.io/reactjs/tutorial/react-js-flux-architecture-tutorial

About 1/3 of the way down:

"Event Emitter - the event emitter is responsible for notifying subscribers after the store has performed some action with data. And vice versa, it should also be able to register observers for certain events. Node s event emitter will be used in the todo application."

Given that Flux is just a template, is there something I can use with .net MVC, in the absence of node, to handle the Event Emitter part?

Thoughts appreciated, thanks.

+5
source share
2 answers

You can use the .NET Delegates, which is well documented here https://msdn.microsoft.com/en-us/library/edzehd2t%28v=vs.110%29.aspx

Delegates are multicast, which means that they can contain links to several event handling methods.

This will, of course, be a server-side implementation of the stream template.

+1
source

We use a client-side thread template without installing node.js on our web servers. To do this, we must use node.js during build on our Team City CI servers to run a gulp task that pushes .jsx files through jsx interpreters and spits out raw js file. Now our stream application is essentially a static .js file that node.js has already interpreted

+1
source

Source: https://habr.com/ru/post/973120/


All Articles