Skip to content

migrated to rematch new types#3

Open
semoal wants to merge 4 commits into
haikyuu:masterfrom
semoal:master
Open

migrated to rematch new types#3
semoal wants to merge 4 commits into
haikyuu:masterfrom
semoal:master

Conversation

@semoal

@semoal semoal commented Aug 19, 2020

Copy link
Copy Markdown

I've migrated to the new types system, all of them working correctly except the testing suite that is running on a circular reference issue.

Type of property 'settings' circularly references itself in mapped type 'ExtractRematchDispatchersFromModels<RootModel & Models<any>>'.ts(2615)

@semoal

semoal commented Aug 19, 2020

Copy link
Copy Markdown
Author

Any suggerence mate? I'm migrating some repos that are not too much complicated to the new types to check if there's any extra issue
@tianzhich

@semoal

semoal commented Aug 19, 2020

Copy link
Copy Markdown
Author

@haikyuu i hope this is not a problem to you =)

@tianzhich

Copy link
Copy Markdown

1st todo: definitely as is not necessary. I forgot pass TModels to ModelEffect.

2nd todo: why we need TExtraModels? It was unused in the real param initConfig so I removed it. And now there is no circular reference issue.

/**
 * Prepares a complete configuration and creates a Rematch store.
 */
export const init = <
	TModels extends Models<TModels>,
	TExtraModels extends Models
>(
	initConfig?: InitConfig<TModels>
): RematchStore<TModels & TExtraModels> => {
	const config = createConfig(initConfig || {})
	return createRematchStore<TModels, TExtraModels>(config)
}

@tianzhich

Copy link
Copy Markdown

PR rematch/rematch#805

@semoal

semoal commented Aug 26, 2020

Copy link
Copy Markdown
Author

Well @haikyuu thanks for letting us rape your project a bit haha
It's all the types fixed, if you find any issue feel free to notify us!

@semoal semoal changed the title Draft: migrated to rematch new types migrated to rematch new types Aug 26, 2020
@semoal semoal marked this pull request as ready for review August 26, 2020 13:16
@haikyuu

haikyuu commented Aug 27, 2020

Copy link
Copy Markdown
Owner

No problem, @semoal It was a pleasure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants