react-native-quizz
react-native-quizz copied to clipboard
migrated to rematch new types
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)
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
@haikyuu i hope this is not a problem to you =)
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)
}
PR https://github.com/rematch/rematch/pull/805
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!
No problem, @semoal It was a pleasure.