Какие есть способы отслеживания подключений, как это делают соцсети?Магии не существует. «Соцсети» просто держат флаг активности ещё несколько секунд после разрыва соединения, чтобы обработать ситуацию «обновления страницы».
Возможно я не в ту сторону думаю?Определённо.
React assumes that every component you write is a pure function. This means that React components you write must always return the same JSX given the same inputs (props, state, and context).https://react.dev/reference/react/StrictMode#fixin...
Components breaking this rule behave unpredictably and cause bugs. To help you find accidentally impure code, Strict Mode calls some of your functions (only the ones that should be pure) twice in development.
Since Next.js 13.4, Strict Mode is true by default with app router. You can still disable Strict Mode by setting reactStrictMode: false.https://nextjs.org/docs/app/api-reference/next-con...
Писать все данные не в основную бд (бд платформы), а во временную бд апи и раз в N минут/часов сгружать данные в основную бдГораздо проще использовать нормальный сервер очередей. Вдобавок, данные будут быстрее попадать в БД не вися в отстойнике.
There is also no mutable string type, but str.join() or io.StringIO can be used to efficiently construct strings from multiple fragments.https://docs.python.org/3.3/library/stdtypes.html#...
outsideClick: function(e) {
var target = $(e.target);
// if the page is clicked anywhere except within the daterangerpicker/button
// itself then call this.hide()
if (
// ie modal dialog fix
e.type == "focusin" ||
target.closest(this.element).length ||
target.closest(this.container).length ||
target.closest('.calendar-table').length
) return;
this.hide();
this.element.trigger('outsideClick.daterangepicker', this);
},
https://github.com/dangrossman/daterangepicker/blo...// Bind global datepicker mousedown for hiding and
$(document)
.on('mousedown.daterangepicker', this._outsideClickProxy)
// also support mobile devices
.on('touchend.daterangepicker', this._outsideClickProxy)
// also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
.on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
// and also close when focus changes to outside the picker (eg. tabbing between controls)
.on('focusin.daterangepicker', this._outsideClickProxy);
https://github.com/dangrossman/daterangepicker/blo...move: function () {
var parentOffset = {
top: this.parentEl.offset().top - (this.parentEl.is('body') ? 0 : this.parentEl.scrollTop()),
left: this.parentEl.offset().left - (this.parentEl.is('body') ? 0 : this.parentEl.scrollLeft())
};
if (this.opens == 'left') {
this.container.css({
top: this.element.offset().top + this.element.outerHeight() - parentOffset.top,
right: $(window).width() - this.element.offset().left - this.element.outerWidth() - parentOffset.left,
left: 'auto'
});
if (this.container.offset().left < 0) {
this.container.css({
right: 'auto',
left: 9
});
}
} else {
this.container.css({
top: this.element.offset().top + this.element.outerHeight() - parentOffset.top,
left: this.element.offset().left - parentOffset.left,
right: 'auto'
});
if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
this.container.css({
left: 'auto',
right: 0
});
}
}
},
_
и элемент не находится.projectPath[projectName].url
If you need even more power, you may use the whereHas and orWhereHas methods to define additional query constraints on your has queries, such as inspecting the content of a comment:https://laravel.com/docs/11.x/eloquent-relationshi...
use Illuminate\Database\Eloquent\Builder; // Retrieve posts with at least one comment containing words like code%... $posts = Post::whereHas('comments', function (Builder $query) { $query->where('content', 'like', 'code%'); })->get(); // Retrieve posts with at least ten comments containing words like code%... $posts = Post::whereHas('comments', function (Builder $query) { $query->where('content', 'like', 'code%'); }, '>=', 10)->get();