Skip to content

Commit

Permalink
Add remove block
Browse files Browse the repository at this point in the history
Co-authored-by: !Ryan <[email protected]>
  • Loading branch information
GarboMuffin and softedco authored Dec 7, 2022
1 parent 3c845b1 commit 42ddc64
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions local-storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
},
},
},
{
opcode: 'remove',
blockType: Scratch.BlockType.COMMAND,
text: 'remove key [key]',
arguments: {
key: {
type: Scratch.ArgumentType.STRING,
defaultValue: 'example'
},
},
},
],
};
}
Expand Down Expand Up @@ -65,5 +76,8 @@
return '';
}
}
remove(args) {
localStorage.removeItem(PREFIX + args.key.toString());
}
Scratch.extensions.register(new LocalStorageExt());
})(Scratch);

0 comments on commit 42ddc64

Please sign in to comment.