File tree Expand file tree Collapse file tree 3 files changed +21
-40
lines changed Expand file tree Collapse file tree 3 files changed +21
-40
lines changed Original file line number Diff line number Diff line change 1
- Skip to content
2
-
3
- Search or jump to…
4
-
5
- Pull requests
6
- Issues
7
- Marketplace
8
- Explore
9
-
10
- @marconi1992
11
- 9
12
- 0
13
- 2 0 marconi1992 /hypernova-vue
14
- Code Issues 0 Pull requests 0 Projects 0 Wiki Security Insights Settings
15
- hypernova-vue /.gitignore
16
- @marconi1992 marconi1992 First steps
17
- ee91b83 on Feb 20
18
- 34 lines (25 sloc) 502 Bytes
19
-
20
1
# Logs
21
2
logs
22
3
* .log
51
32
npm-shrinkwrap.json
52
33
yarn.lock
53
34
package-lock.json
54
- © 2019 GitHub, Inc.
55
- Terms
56
- Privacy
57
- Security
58
- Status
59
- Help
60
- Contact GitHub
61
- Pricing
62
- API
63
- Training
64
- Blog
65
- About
66
-
67
- example
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " hypernova-svelte" ,
3
- "version" : " 1.1 .0" ,
3
+ "version" : " 1.2 .0" ,
4
4
"description" : " Svelte Bindings for Hypernova" ,
5
5
"main" : " lib/index.js" ,
6
6
"author" : " Felipe Guizar Diaz <felipegaiacharly@gmail.com>" ,
Original file line number Diff line number Diff line change 1
1
import hypernova , { serialize , load } from 'hypernova' ;
2
2
import { findNode , getData } from 'nova-helpers' ;
3
3
4
- const mountComponent = ( Component , node , data ) => {
5
- return new Component ( {
6
- target : node ,
7
- props : data ,
8
- hydrate : true ,
9
- } ) ;
4
+ export { load } from 'hypernova' ;
5
+
6
+ export const loadById = ( name , id ) => {
7
+ const node = findNode ( name , id ) ;
8
+ const data = getData ( name , id ) ;
9
+
10
+ if ( node && data ) {
11
+ return {
12
+ node,
13
+ data,
14
+ } ;
15
+ }
16
+
17
+ return null ;
10
18
} ;
11
19
20
+ export const mountComponent = ( Component , node , data ) => new Component ( {
21
+ target : node ,
22
+ props : data ,
23
+ hydrate : true ,
24
+ } ) ;
25
+
12
26
export const renderInPlaceholder = ( name , Component , id ) => {
13
27
const node = findNode ( name , id ) ;
14
28
const data = getData ( name , id ) ;
You can’t perform that action at this time.
0 commit comments