1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-18 09:35:20 +02:00
joplin/ReactNativeClient/lib/services/commands/propsHaveChanged.ts
Laurent Cozic 3a57cfea02 Desktop: Simplified and improve command service, and added command palette
- Commands "enabled" state is now expressed using a "when-clause" like in VSCode
- A command palette has been added to the Tools menu
2020-10-18 21:52:10 +01:00

16 lines
370 B
TypeScript

export default function propsHaveChanged(previous:any, next:any):boolean {
if (!previous && next) return true;
if (previous && !next) return true;
if (!previous && !next) return false;
if (Object.keys(previous).length !== Object.keys(next).length) return true;
for (const n in previous) {
if (previous[n] !== next[n]) {
return true;
}
}
return false;
}