storyshare

3.22.5 • Public • Published

StoryShare API Handler

Initialize the API:

import Site from 'storyshare';

let s = new Site();
s.start()
.then(launchApp());

Dispatch a request using a tracking key:

componentWillMount() {
  s.req('posts').track('newsfeed').read();
}

or with a promise once complete, to run further actions:

componentWillMount() {
  s.req('posts').track('newsfeed').promise().read()
  .then(posts => console.log('got some posts', posts));
}

Get the completion state, and the response content:

const mapStateToProps = (state) => ({
  feedReady: s.getComplete('newsfeed'),
  newsFeed: s.getResponse('newsfeed')
});

render() {
  return this.props.feedReady ?
    props.newsFeed.map(({ title, content }) => <div><h1>{ title }</h1><p>{ content }</p></div>)
    <Spinner />;
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
3.22.50latest

Version History

VersionDownloads (Last 7 Days)Published
3.22.50
3.22.40
3.22.30
3.22.20
3.22.10
3.22.00
3.21.00
3.20.00
3.19.00
3.18.40
3.18.30
3.18.20
3.18.10
3.18.00
3.17.00
3.16.40
3.16.30
3.16.20
3.16.10
3.16.00
3.15.00
3.14.30
3.14.20
3.14.10
3.13.30
3.14.00
3.13.20
3.13.10
3.13.00
3.12.20
3.12.10
3.12.00
3.11.140
3.11.130
3.11.120
3.11.110
3.11.100
3.11.90
3.11.80
3.11.70
3.11.60
3.11.50
3.11.40
3.11.30
3.11.20
3.11.10
3.11.00
3.10.00
3.9.170
3.9.160
3.9.150
3.9.140
3.9.130
3.9.120
3.9.110
3.9.100
3.9.90
3.9.80
3.9.70
3.9.61
3.9.50
3.9.40
3.9.30
3.9.20
3.9.10
3.9.00
3.8.30
3.8.21
3.8.10
3.8.00
3.7.41
3.7.30
3.7.10
3.7.00
3.6.00
3.5.10
3.5.01
3.4.120
3.4.110
3.4.100
3.4.80
3.4.70
3.4.60
3.4.50
3.4.40
3.4.30
3.4.20
3.4.11
3.2.81
3.2.70
3.2.60
3.2.50
3.2.40
3.2.30
3.2.20
3.2.10
3.2.00
3.1.00
3.0.490
3.0.480
3.0.470
3.0.460
3.0.450
3.0.440
3.0.430
3.0.420
3.0.410
3.0.400
3.0.390
3.0.380
3.0.370
3.0.360
3.0.350
3.0.340
3.0.330
3.0.320
3.0.310
3.0.300
3.0.290
3.0.280
3.0.270
3.0.260
3.0.250
3.0.240
3.0.230
3.0.220
3.0.210
3.0.200
3.0.190
3.0.180
3.0.170
3.0.160
3.0.150
3.0.140
3.0.130
3.0.120
3.0.110
3.0.100
3.0.90
3.0.80
3.0.70
3.0.60
3.0.50
3.0.40
3.0.30
3.0.20
3.0.10
3.0.00

Package Sidebar

Install

npm i storyshare

Weekly Downloads

6

Version

3.22.5

License

UNLICENSED

Unpacked Size

1.6 MB

Total Files

160

Last publish

Collaborators

  • npmchrisl
  • simpleigh