A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/markerikson/project-minimek/commit/36324ea46ae1f0fcda44816c3820c255a82aa5a8 below:

Clear out existing models on load to avoid conflicts when reloading data · markerikson/project-minimek@36324ea · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+7

-0

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+7

-0

lines changed Original file line number Diff line number Diff line change

@@ -14,6 +14,13 @@ export function loadData(state, payload) {

14 14 15 15

const {pilots, designs, mechs} = payload;

16 16 17 +

// Clear out any existing models from state so that we can avoid

18 +

// conflicts from the new data coming in if data is reloaded

19 +

[Pilot, Mech, MechDesign].forEach(modelType => {

20 +

modelType.all().withModels.forEach(model => model.delete());

21 +

session.state = session.reduce();

22 +

});

23 + 17 24

// Queue up creation commands for each entry

18 25

pilots.forEach(pilot => Pilot.parse(pilot));

19 26

designs.forEach(design => MechDesign.parse(design));

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4