-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update build and contract files, move contract to source
- Loading branch information
Showing
9 changed files
with
217 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
export function reset(state) { | ||
interface MyState { | ||
value: number; | ||
} | ||
|
||
export function reset(state: MyState) { | ||
const newValue = 0; | ||
state.set('value', 0); | ||
return newValue | ||
} | ||
export function inc(state, {x}) { | ||
export function inc(state: MyState, {x}) { | ||
const oldValue = state.get('value') ?? 0; | ||
const newValue = oldValue + x; | ||
state.set('value', newValue); | ||
return newValue | ||
} | ||
export function dec(state, {x}) { | ||
export function dec(state: MyState, {x}) { | ||
const oldValue = state.get('value') ?? 0; | ||
const newValue = oldValue - x; | ||
state.set('value', newValue); | ||
return newValue | ||
} | ||
|
||
export function read(state) { | ||
export function read(state: MyState) { | ||
return state.get('value'); | ||
} |
Oops, something went wrong.