ericclemmons / react-resolver

Async rendering & data-fetching for universal React applications.
https://ericclemmons.github.io/react-resolver
Other
1.65k stars 52 forks source link

passing normal props with create container #46

Closed gilesbradshaw closed 9 years ago

gilesbradshaw commented 9 years ago

link and linkName are just normal non async props. - is there/could there be a better way to pass them than..

export var YoAlt = Resolver.createContainer(InnerComponent, {
  resolve: {
    linkName:()=>"APPPPPP",
    link:()=>'app1',  
    list: (props, context)=> 
     new Promise(
        resolve=>
          setTimeout(
            (()=>
              resolve(new List([{id:0,content:"ahhhh"}]))
              ),
            1000)
        )
  }
});

for example maybe

export var YoAlt = Resolver.createContainer(InnerComponent, {
  props:{
    linkName:'APPPPP',
    link:'app1'
  },
  resolve: {
     list: (props, context)=> 
     new Promise(
        resolve=>
          setTimeout(
            (()=>
              resolve(new List([{id:0,content:"ahhhh"}]))
              ),
            1000)
        )
  }
});
ericclemmons commented 9 years ago

Makes sense to me! I can adjust this...

iamdustan commented 9 years ago

Is this different than #36?

gilesbradshaw commented 9 years ago

Looks like it is addressing the same issue @iamdustan thanks!

ericclemmons commented 9 years ago

Fixed in v1.2.0 & v1.2.1 (#36)