Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
eladb committed Apr 2, 2024
1 parent a84ed4b commit 1ed76b3
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions libs/wingsdk/src/simulator/simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -916,16 +916,13 @@ export class Simulator {

case UpdatePlan.REPLACE:
return true;
}

// the resource is already in "current", if it's different from "next", it means it was updated
const state = (r: BaseResourceSchema) =>
JSON.stringify({
props: r.props,
type: r.type,
});
case UpdatePlan.AUTO:
const state = (r: BaseResourceSchema) =>
JSON.stringify({ props: r.props, type: r.type });

return state(oldConfig) !== state(newConfig);
return state(oldConfig) !== state(newConfig);
}
}
}

Expand Down Expand Up @@ -1014,7 +1011,7 @@ export interface ISimulatorResourceInstance {
* If this is not implemented, the default behavior is to automatically replace the resource if
* the new configuration is different from the current configuration.
*
* @param newConfig The new configuration to apply
* @param newConfig The new configuration to apply (this could include unresolved tokens)
*/
plan(newConfig: BaseResourceSchema): Promise<UpdatePlan>;
}
Expand Down

0 comments on commit 1ed76b3

Please sign in to comment.