Type improvements
Summary: some type simplifications, that makes it easier to reuse data sources and helps type inference Reviewed By: passy Differential Revision: D28413380 fbshipit-source-id: 261a8b981bf18a00edc3075926bd668322e1c37d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9a2677fc24
commit
bc647972e1
@@ -7,10 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
// ok for now, should be factored if this becomes a stand-alone lib
|
||||
// eslint-disable-next-line
|
||||
import {createDataSource} from '../../state/createDataSource';
|
||||
import {DataSource} from '../DataSource';
|
||||
import {DataSource, createDataSource} from '../DataSource';
|
||||
|
||||
type Todo = {
|
||||
id: string;
|
||||
@@ -487,7 +484,7 @@ test('clear', () => {
|
||||
|
||||
function testEvents<T>(
|
||||
initial: T[],
|
||||
op: (ds: DataSource<T, any, any>) => void,
|
||||
op: (ds: DataSource<T>) => void,
|
||||
key?: keyof T,
|
||||
): any[] {
|
||||
const ds = createDataSource<T>(initial, {key});
|
||||
|
||||
Reference in New Issue
Block a user