Skip to content

Commit

Permalink
feat(core/options): adds forceUpdate
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Apr 30, 2019
1 parent 3bda9df commit 1dd5648
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { setLevel } from '~/utils/logger';
import hash from 'object-hash';

export const state = {
force: 0,
base: {
file: null,
directory: null,
Expand Down Expand Up @@ -35,6 +36,10 @@ export default {
resetScope(): void {
state.scope = {};
merge();
},
forceUpdate(): void {
state.force += 1;
merge();
}
};

Expand All @@ -51,7 +56,7 @@ function merge(): void {
// Set logging level
if (options.log) setLevel(options.log);
// Set id to object hash
id = hash(options);
id = hash(options) + state.force;
}

function stripUndefined(obj: IOfType<any>): IOfType<any> {
Expand Down

0 comments on commit 1dd5648

Please sign in to comment.