Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TS Migration] Migrate storage, utils and OnyxCache to Typescript #469

Merged
merged 16 commits into from
Feb 15, 2024
Merged
14 changes: 14 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ module.exports = {
'@typescript-eslint/array-type': ['error', {default: 'array-simple'}],
'@typescript-eslint/consistent-type-definitions': 'off',
'rulesdir/no-multiple-onyx-in-file': 'off',
'valid-jsdoc': 'off',
'rulesdir/prefer-import-module-contents': 'off',
'es/no-optional-chaining': 'off',
'es/no-nullish-coalescing-operators': 'off',
pecanoro marked this conversation as resolved.
Show resolved Hide resolved
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
},
{
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ dist/

# Decrypted private key we do not want to commit
.github/OSBotify-private-key.asc

# Published package
*.tgz
4 changes: 2 additions & 2 deletions lib/Onyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ function keysChanged(collectionKey, partialCollection, notifyRegularSubscibers =
const previousData = prevState[subscriber.statePropertyName];

// Avoids triggering unnecessary re-renders when feeding empty objects
if (utils.areObjectsEmpty(data, previousData)) {
if (utils.isEmptyObject(data) && utils.isEmptyObject(previousData)) {
return null;
}
if (data === previousData) {
Expand Down Expand Up @@ -674,7 +674,7 @@ function keyChanged(key, data, prevData, canUpdateSubscriber = () => true, notif
const prevWithOnyxData = prevState[subscriber.statePropertyName];

// Avoids triggering unnecessary re-renders when feeding empty objects
if (utils.areObjectsEmpty(data, prevWithOnyxData)) {
if (utils.isEmptyObject(data) && utils.isEmptyObject(prevWithOnyxData)) {
return null;
}
if (prevWithOnyxData === data) {
Expand Down
236 changes: 0 additions & 236 deletions lib/OnyxCache.js

This file was deleted.

Loading
Loading