8
votes
Event functionality in C
Files
The EventListener.h file should contain only declarations, as it needs to be safe to include in object files that are linked together. Put the definitions ...
7
votes
Making an Action<T> event also usable as Action<object> and Action in C#
no memory should leak when it is used correctly.
Adding and removing a handler results in an empty List<T> lingering in the ...
7
votes
Accepted
Flex panels in CSS and JS
It looks pretty good to me. I can only see a few things to consider:
More precise propertyName check You have if(e.propertyName.includes('flex')) { because Safari ...
7
votes
Accepted
Event System using C++
Avoid macros
There are many issues with macros, the general advice is to avoid them where possible.
Let's look at EVENT_TYPE_FUNCTION(): it's there to add a few ...
7
votes
CAT: Cat Approved TUIs
You appear to be asking for a review the part of the code you posted, not the library itself. (ETA: I wrote this before you posted any of the library code.) I’m not sure how useful that will be, but ...
6
votes
Accepted
Event handling attempt using some of the c++ 17 features
I'm actually not the right person to properly review your code, since event handling is outside my particular experience, so the overall idea of even having this kind of observer-handler-emitter ...
6
votes
Accepted
Simple implementation of signals and slots mechanism using templates
[code] uint64_t
It should be std::uint64_t, not uint64_t for key indexes (the latter is the C version). Or better: use ...
6
votes
Angular directive to disable a button when clicked, allowing re-enabling as needed
One of the main ways in which you can improve this is by using Renderer2 in the directive instead of directly accessing this.el.nativeElement and making changes to ...
6
votes
Accepted
Simple input class change with vanilla JS
Review
The biggest critique about the Javascript I have is that collapsedInput could be declared with const because it doesn't ...
6
votes
Process queued data in the background
Alternatives
There are plenty of robust options for message queueing in C# that handle multithreading gracefully as well as scaling to truly massive sizes.
The microsoft solution is MSMQ.
There ...
6
votes
Accepted
Wrap a js function with a fixed this arg
is there a better way to achieve this functionality?
You can use Function.bind() to create a function with the this context ...
6
votes
Animated Calendar using HTML + CSS + JS
Variables
Always use a variable declaration when first declaring your variable. If you don't your variable will be put into the global scope, which is almost never what you want. It also makes it more ...
6
votes
Accepted
Animated Calendar using HTML + CSS + JS
Welcome to Code Review. The CSS looks quite good. I haven’t seen too many style sheets with color lightsalmon 😃. Below are some suggestions.
Cache DOM references
”...
6
votes
is this a good way of using events?
What you've done is conceptually wrong
Events are there to allow other objects to be notified and react when something happens.
That said, your solution works and does what you want, at least at a ...
6
votes
Accepted
Event Dispatching System
Delete the default constructor of Event
The default constructor of Event doesn't initialize ...
6
votes
Follow up: A chat server using the select() API
Nice effort.
This review only addresses 2 of the 10 questions. I hope OP gets a review of the other 8 questions too.
Does any part of my code exhibit undefined behaviour?
Calls to ...
6
votes
EventBus in C++
EventBus::get_instance().push_to_queue(std::move(event));
EventBus::get_instance().process_queue();
Those seem inconvenient for the caller to write.
...
6
votes
EventBus in C++
std::forward_list
Is there a specific reason you are re-implementing a linked list inside of your event bus? Why not use ...
6
votes
Event System using C++
General Observations
This code review request does not present any C++ source files (.cpp files). It appears that you are trying to write close code without the <...
6
votes
CAT: Cat Approved TUIs
Unfortunately you've only shown some of the header files, but no concrete implementation of your TUI library, so I cannot meaningfully review that. However, we can look at your intended use of the TUI....
5
votes
Accepted
A C#-style Event object in C++
Event is almost threadsafe
Why almost? Well, you don't take the lock in Count. That means that some thread could be making ...
5
votes
Accepted
Manipulating the browser history
An appropriate term for this code is spaghetti code – it's tightly intertwined with other parts of the app, so one cannot easily take out a part of it and reason about it without thinking about the ...
5
votes
Accepted
Simple event dispatcher
Design
Is there a need for IEventDispatcher? Defining it as an abstract base class doesn't provide much utility if there's only ever going to be one derived class.
...
5
votes
Accepted
UpvoteJS, a simple voting widget in vanilla JavaScript
Foreword
There is quite a bit of code here and it has taken a bit of time to process - especially the unit tests. I feel like the thoughts below will be incomplete but if I think of other ideas in ...
5
votes
Accepted
Tic-Tac-Toe code in JavaScript
Note, some of these require a build process
the iife should be added in the build process, it's distracting
The code doesn't expose anything. It's untestable.
var should be let or const
You can use ...
5
votes
Making an Action<T> event also usable as Action<object> and Action in C#
Review
You wrap all event signatures into Action<T>. I would instead store all event listeners as their common base type ...
5
votes
Dynamically add/remove fields on input
Put styles in stylesheet, and use semantic markup.
It's easier to think about the problem if it is a list of input controls.
You would most probably want to reset the hidden inputs, because in case a ...
5
votes
Accepted
"Block a website" script with vanilla JavaScript
The main suggestion I have is to take the values from sitesToBlock and put them in the @match metadata key instead of detecting ...
5
votes
Resizable containers with VueJS
In accordance with the D.R.Y. principle: the markup can be simplified by registering a component - and a template can be used with an X-Template. For example - add a ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
event-handling × 466javascript × 218
jquery × 80
c# × 78
c++ × 67
java × 57
html × 42
dom × 42
beginner × 34
ecmascript-6 × 34
object-oriented × 23
css × 21
form × 20
game × 18
performance × 17
c++11 × 16
swing × 16
callback × 14
wpf × 13
gui × 12
multithreading × 11
design-patterns × 11
.net × 11
thread-safety × 11
android × 10