mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[feature-136] Add model types icons + export models + init delete models + init searchbar
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { useState } from "react";
|
||||
import { BehaviorSubject } from "rxjs";
|
||||
import { useObservable } from "./use-observable.hook";
|
||||
import { useConstant } from "./use-constant.hook";
|
||||
|
||||
export function useBehaviorSubject<T>(value: T): [T, BehaviorSubject<T>]{
|
||||
const [subject] = useState(new BehaviorSubject(value));
|
||||
const subject = useConstant(() => new BehaviorSubject(value));
|
||||
const subjectValue = useObservable(subject);
|
||||
|
||||
return [subjectValue, subject];
|
||||
|
||||
Reference in New Issue
Block a user