Skip to content

Commit

Permalink
Type fixes for createModel(), InsertEvent, RemoveEvent, Subscribable
Browse files Browse the repository at this point in the history
  • Loading branch information
ericyhwang committed Apr 8, 2024
1 parent ff9adb7 commit aae0fb4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Model/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ export class InsertEvent {
declare type: 'insert';
declare _immediateType: 'insertImmediate';
index: number;
values: any;
values: any[];
passed: any;

constructor(index, values, passed) {
Expand All @@ -678,8 +678,9 @@ export class RemoveEvent {
declare _immediateType: 'removeImmediate';
index: number;
passed: any;
removed: any;
values: any;
removed: any[];
/** @deprecated Use `removed` instead */
values: any[];

constructor(index, values, passed) {
this.index = index;
Expand Down
2 changes: 1 addition & 1 deletion src/Model/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const promisify = util.promisify;
/**
* A path string, a `Model`, or a `Query`.
*/
export type Subscribable = string | Model<unknown> | Query;
export type Subscribable = string | Model<unknown> | Query<unknown>;

declare module './Model' {
interface Model<T> {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export {

export const racer = new Racer();

export function createModel(data) {
export function createModel(data?) {
var model = new RootModel();
if (data) {
model.createConnection(data);
Expand Down

0 comments on commit aae0fb4

Please sign in to comment.