Skip to content

Instantly share code, notes, and snippets.

@Grubba27
Last active October 21, 2022 14:20
Show Gist options
  • Select an option

  • Save Grubba27/45a73085a551fd3c4442e6d4df1ceaca to your computer and use it in GitHub Desktop.

Select an option

Save Grubba27/45a73085a551fd3c4442e6d4df1ceaca to your computer and use it in GitHub Desktop.
simple example of using this
function outer(props) {
const self = this;
self.outer = 'outer';
function inner(props, ctx) {
const self = this;
self.inner = 'inner';
ctx.outer = 'outer-malucao'
return {
inner: self.inner,
ctx: ctx.outer,
props
};
}
return inner(props, self);
}
outer('some')
// ^^{inner: 'outer-malucao', ctx: 'outer-malucao', props: 'some'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment