add createService (#6)

This commit is contained in:
Kilin Mikhail
2020-12-26 00:20:01 +03:00
committed by GitHub
parent fd79931b16
commit 6d605cd325
4 changed files with 63 additions and 6 deletions

View File

@ -3,7 +3,7 @@ import {Stream, Sink} from '@most/types';
import {newDefaultScheduler} from '@most/scheduler';
import {pending, RemoteData} from '@devexperts/remote-data-ts';
// eslint-disable-next-line no-empty-function
// eslint-disable-next-line
const emptyFunc = () => {};
export const useStream = <T>(stream$: Stream<T>, defaultValue: T): T => {
@ -22,7 +22,7 @@ export const useStream = <T>(stream$: Stream<T>, defaultValue: T): T => {
return () => {
effect$.dispose();
};
}, []);
}, [stream$]);
return state;
};